Conal Elliott's Blog

Conal Elliott

Monad I don’t know if there’s a useful or practical Monad instance for StreamBot i that is consistent with the Applicative instance (i.e., with ap == (<*>)). I think each new bot to come out of (>>=) or join would have to be fed the same, full input stream, which would lead to a tremendous time-space leaks.


We’re in luck (or forethought)!


I like how these new definitions of pairR and (<*>) build on other generally useful combinators. In contrast, my previous (<*>) definition is recursive and uses the representation of reactive values and events.


When I think of a behavior as a function of time, I’d like it to act like a function of time, hence Functor, Applicative, and Monad. And if it does implement any classes in common with functions, then it had better agree the function instances of those classes. Otherwise, user expectations will be mistaken, and the illusion is broken.