Skip to content

Commit

Permalink
Use run instead of unlift for consistency
Browse files Browse the repository at this point in the history
  • Loading branch information
fmthoma committed Aug 5, 2017
1 parent 849e856 commit 9816f40
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions Control/Monad/Trans/Control.hs
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,7 @@ import Prelude (id)
--
-- @
-- withFileLifted' :: MonadTransControl t => FilePath -> IOMode -> (Handle -> t IO r) -> t IO r
-- withFileLifted' file mode action = liftWith $ \\unlift -> withFile file mode (unlift action)
-- withFileLifted' file mode action = liftWith $ \\run -> withFile file mode (run action)
-- @
class MonadTrans t => MonadTransControl t where
-- | Monadic state of @t@.
Expand Down Expand Up @@ -198,7 +198,12 @@ class MonadTrans t => MonadTransControl t where
-- The difference with 'lift' is that before lifting the @m@ computation
-- @liftWith@ captures the state of @t@. It then provides the @m@
-- computation with a 'Run' function that allows running @t n@ computations in
-- @n@ (for all @n@) on the captured state.
-- @n@ (for all @n@) on the captured state, e.g.
--
-- @
-- withFileLifted :: MonadTransControl t => FilePath -> IOMode -> (Handle -> t IO r) -> t IO r
-- withFileLifted file mode action = liftWith $ \\run -> withFile file mode (run action)
-- @
--
-- If the @Run@ function is ignored, @liftWith@ coincides with @lift@:
--
Expand Down

0 comments on commit 9816f40

Please sign in to comment.