[Haskell-cafe] Feeding a monad into itself

Silvio Frischknecht silvio.frischi at gmail.com
Fri Jul 21 06:32:00 UTC 2017

Well you can usually replace a recursion with a fix and a case Maybe
with a maybe. Then you would get something like this.

untilNothing f = fix (\f' a -> maybe a f' (f a))

But it's really unreadable. Or at least I can't read it. Though it's fun
to think up. Also no connection to monads.

Cheers Silvio

More information about the Haskell-Cafe mailing list