[Haskell-beginners] Small question

edgar klerks edgar.klerks at gmail.com
Sun Feb 28 16:06:06 EST 2010


Hi there,

I have created a function mkc:

mkc :: (a -> b) -> a -> m b
mkc f = (\x -> return $ f x)

which works wonderful in statements like:

number <- many1 digit >>= mkc(read)

But somehow I think this function should already exist, it is some kind of
lifting. If it exist where can I find it? Or is there a reason, why it isn't
in prelude, because it is more elegant way to solve this problem.

Thanks in advance,

Edgar
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.haskell.org/pipermail/beginners/attachments/20100228/aa53dbe3/attachment.html


More information about the Beginners mailing list