[Haskell-cafe] How to catch exception within the Get monad (the Binary package)

Victor Gorokhov me at rkit.pp.ru
Sun Sep 5 15:09:10 EDT 2010


> If however something goes wrong, and prs fails, the whole function
> fails (error is thrown). Since [a] (result of decoding) is a lazy
> list, actual exception may be thrown at any moment the list is being
> processed, and exception handler may not be properly set.

> True -> return (reverse a)
> False -> many' (s:a)
Lazy lists are built in left to right order, but this one is right to left.


> Is there any way to catch/detect failures inside the Get monad?
lookAhead, lookAheadM, etc


More information about the Haskell-Cafe mailing list