rmonad-0.8: Restricted monad library

Safe HaskellSafe-Inferred




data AsMonad m a Source

A wrapper type that can be used to embed an arbitrary restricted monad as a normal monad.

Note that in general there can be an efficiency loss in using AsMonad where the underlying restricted monad could have been used instead. For example when using Set with AsMonad, intermediate results will not have duplicates removed. On the other hand, it becomes legal to use intermediate results that do not have Ord instances.


embed :: Suitable m a => m a -> AsMonad m aSource

Turn a restricted monad into a normal monad

unEmbed :: Suitable m a => AsMonad m a -> m aSource

Unwrap an AsMonad value into the enclosed restricted monad