16 Dec
2015
16 Dec
'15
6:43 a.m.
I realized this does not quite satisfy the law pure x >>= f = f x In particular, pure () >>= (\() -> m) :: Backwards m is a divergent computation whenever m is a "strict" monad. Things seem somewhat nicer when m is "lazy", but there could be further problems I've overlooked. On Tue, Dec 15, 2015 at 2:20 PM, David Feuer <david.feuer@gmail.com> wrote:
In particular, I'm thinking about
instance MonadFix m => Monad (Backwards m) where m >>= f = Backwards $ do fin <- forwards (f int) int <- forwards m return fin
It looks to me like this should be valid, and compatible with the Applicative instance, but maybe I'm missing something.