Re: Functor => Pointed => Applicative => Monad

5 Dec
2010
5 Dec
'10
2:50 a.m.
On 12/4/10 6:32 AM, Sebastian Fischer wrote:
Hi Wren,
On Sat, 2010-12-04 at 01:25 -0500, wren ng thornton wrote:
data SliceUnder a b = SliceUnder (b->a)
instance Functor (SliceUnder a) where fmap f (SliceUnder g) = SliceUnder (g . f)
Couldn't match type `a1' with `b'
Ha, righto! That one's contravariant, whoops. class ContraFunctor f where contraMap :: (a -> b) -> (f b -> f a) instance ContraFunctor (SliceUnder a) where contraMap f (SliceUnder g) = SliceUnder (g . f) That'll teach me to rattle things off without typechecking them. -- Live well, ~wren
5327
Age (days ago)
5327
Last active (days ago)
0 comments
1 participants
participants (1)
-
wren ng thornton