[Haskell-cafe] Stacked return
KAction at gnu.org
Sat Nov 23 17:30:23 UTC 2013
> Perhaps you just want monad transformers [1, 2]. If you're not familiar
> with them, you should probably read .
> With transformers you'd be able to do this (and more):
> $ return 2 :: IO Int
> $ return 2 :: ListT Maybe Int -- this works like Maybe [Int]
> $ return 2 :: MaybeT  Int -- this works like [Maybe Int]
In fact, I read and used transformers a bit. If I understand correctly,
I can only do such things for monads, supported by transformers. So,
I cant get (return 2) :: MyWierdMonad (MyAnotherMonad 2)
Yes, I know, it have little practical use, but I am insterested about
teoretical part of question, magic of ghc.
Best regards, Dmitry Bogatov <KAction at gnu.org>,
Free Software supporter and netiquette guardian.
git clone git://kaction.name/rc-files.git --depth 1
Html mail and proprietary format attachments are forwarded to /dev/null.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Size: 835 bytes
Desc: not available
More information about the Haskell-Cafe