Skip to content
This repository has been archived by the owner on Feb 3, 2021. It is now read-only.

Commit

Permalink
* mtl2 compat.
Browse files Browse the repository at this point in the history
  • Loading branch information
audreyt committed Jul 17, 2012
1 parent 82ede96 commit d95d83a
Showing 1 changed file with 1 addition and 8 deletions.
9 changes: 1 addition & 8 deletions Pugs/src/Pugs/Cont.hs
Expand Up @@ -10,7 +10,7 @@
-}

module Pugs.Cont (
callCCT, shift, reset, shiftT, resetT,
callCCT, shiftT, resetT,
module Control.Monad.Cont,
) where

Expand All @@ -31,13 +31,6 @@ callCCT f = callCC f' where
-- ghc doesn't allow something like m (forall c. m c)
newtype EmptyMonad m = EmptyMonad { runEmptyMonad :: forall c. m c }

-- shift/reset for the Cont monad
shift :: ((a -> Cont s r) -> Cont r r) -> Cont r a
shift e = Cont $ \k -> e (return . k) `runCont` id

reset :: Cont a a -> Cont r a
reset e = return $ e `runCont` id

-- shiftT/resetT for the ContT monad transformer
shiftT :: Monad m => ((a -> ContT r m s) -> ContT s m s) -> ContT s m a
shiftT e = ContT $ \k -> e (C.lift . k) `runContT` return
Expand Down

0 comments on commit d95d83a

Please sign in to comment.