Recently I had to navigatate trough data structures chained with mutable
referenes in th STM monad. The problem is that their values are enveloped in
Either or Maybe results.
functional compositions in the Either of Maybe , or list monads are not
possible when the values are embedded inside
On Tue, Feb 22, 2011 at 3:03 PM, Alberto G. Corona agocor...@gmail.com wrote:
Recently I had to navigatate trough data structures chained with mutable
referenes in th STM monad. The problem is that their values are enveloped in
Either or Maybe results.
functional compositions in the Either of
You need the MaybeT and EitherT monad transformers:
http://hackage.haskell.org/packages/archive/MaybeT/0.1.2/doc/html/Control-Monad-Maybe.html
http://hackage.haskell.org/packages/archive/MaybeT/0.1.2/doc/html/Control-Monad-Maybe.html
On Tue, Feb 22, 2011 at 2:03 PM, Alberto G. Corona agocor...@gmail.com wrote:
Recently I had to navigatate trough data structures chained with mutable
referenes in th STM monad. The problem is that their values are enveloped in
Either or Maybe results.
functional compositions in the Either of
From: Alberto G. Corona agocor...@gmail.com
Sent: Tue, February 22, 2011 3:03:56 PM
Recently I had to navigatate trough data structures chained with mutable
referenes in th STM monad. The problem is that their values are enveloped in
Either or Maybe results.
...
to summarize, given:
foo, :
Am 22.02.2011 um 22:03 schrieb Alberto G. Corona:
Recently I had to navigatate trough data structures chained with mutable
referenes in th STM monad. The problem is that their values are enveloped in
Either or Maybe results.
functional compositions in the Either of Maybe , or list
I have a function 'justm' for this specific case:
-- | This is sort of like a monad transformer, but the Maybe is on the inside
-- instead of the outside.
--
-- What I really want here is MaybeT, but it requres explicit lifting...
justm :: (Monad m) = m (Maybe a) - (a - m (Maybe b)) - m (Maybe b)