
28 Aug
2011
28 Aug
'11
12:21 p.m.
On Sun, 2011-08-28 at 11:48 -0300, Felipe Almeida Lessa wrote:
On Sun, Aug 28, 2011 at 7:41 AM, Tony Morris
wrote: Pointed f => Pointed (StateT s f)
but not
Applicative f => Applicative (StateT s f)
But we do have
(Functor m, Monad m) => Applicative (StateT s m)
so I'm not sure if this is a valid example.
Cheers,
newtype StateT s m a = StateT (s -> m (a, s)) instance Functor m => Functor (StateT s m) where f `fmap` StateT g = StateT $ fmap (first f) . g instance Pointed m => Pointed (StateT s m) where point x = StateT $ point . (,) x Regards