Open idontgetoutmuch opened 10 years ago
It would also match the behaviour of the instance for :->:
from Data.MemoTrie
and :-*
from Data.LinearMap
.
I struggled with this choice. The unconventional choice I made is much more general and usefully so. For instance, it allows time- and/or space-varying versions scalar multiplication. As mentioned in the comment, Shady exploits the generalized form nicely for lighting, as did Vertigo (IIRC). I was able to write simple and generic lighting formulas and apply them to functions from lighting environments.
Thanks for pointing out the inconsistency with memo tries and linear maps. I'd like a consistent choice.
The code commented out is what I would expect from normal mathematical usage. Specifically
$$ (\lambda f)(x) = \lambda f(x) $$
I suppose one could use e.g. (const 3.0) *^ f but this seems to make what I assume would be a common case somewhat obscure.