[Haskell-beginners] Problems with lifting code

Imants Cekusins imantc at gmail.com
Sun Oct 2 16:20:48 UTC 2016


> I am not sure  why the constructor is used on the LHS of (2)

lift1 :: (a -> a) -> b a -> b a
lift1 o (MyNum x) = MyNum (o x)

2nd arg to lift1 is b a

o expects a

by adding ctor (MyNum a), we get to a

lift1 o (b a) = ...

without ctor MyNum, x is b a, not a
​
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.haskell.org/pipermail/beginners/attachments/20161002/e0e3168b/attachment.html>


More information about the Beginners mailing list