You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
newtype NT m a = MkNT {unNT :: forall b. a -> m b}
foobar1 :: (b -> a) -> NT m a -> NT m b
foobar1 f nt = MkNT $ \ a -> unNT nt (f a)
foobar2 :: (b -> a) -> NT m a -> NT m b
foobar2 f (MkNT nt) = MkNT $ \ a -> nt (f a)
Although they both should work, foobar1 doesn't. The use of unNT gives rise to a wanted m @ b constraint.
one could type foobar1 :: Total m => (b -> a) -> NT m a -> NT m b. The total constraint is needed here as m as it can be applied to any b
The text was updated successfully, but these errors were encountered:
Although they both should work,
foobar1
doesn't. The use ofunNT
gives rise to a wantedm @ b
constraint.one could type
foobar1 :: Total m => (b -> a) -> NT m a -> NT m b
. The total constraint is needed here asm
as it can be applied to anyb
The text was updated successfully, but these errors were encountered: