playground-common-0.1.0.0
Safe HaskellSafe-Inferred
LanguageHaskell2010

Control.Monad.Trace

Synopsis

Documentation

type TraceMaybe a = MaybeT (Writer (Last a)) Source #

Trace is a neat way to run a Maybe monad, but leave a trail behind so that if it fails, we know what step it failed at.

withTrace :: Monad m => Maybe a -> MaybeT m a Source #

attempt :: a -> TraceMaybe a () Source #

runTrace :: e -> TraceMaybe e a -> Either e a Source #