in-other-words-0.1.0.0: A higher-order effect system where the sky's the limit

Safe HaskellNone
LanguageHaskell2010

Control.Effect.Internal.Cont

Synopsis

Documentation

newtype Cont m a where Source #

An effect for abortive continuations.

Constructors

CallCC :: ((forall b. a -> m b) -> m a) -> Cont m a 

newtype Shift r m a where Source #

An effect for non-abortive continuations of a program that eventually produces a result of type r.

This isn't quite as powerful as proper delimited continuations, as this doesn't provide any equivalent of the reset operator.

This can be useful as a helper effect.

Constructors

Shift :: ((a -> m r) -> m r) -> Shift r m a 

data ContBase r a where Source #

Constructors

Exit :: r -> ContBase r a 
GetCont :: ContBase r (Either (a -> r) a) 

newtype ContC r m a Source #

Constructors

ContC 

Fields

Instances
MonadBase b m => MonadBase b (ContC r m) Source # 
Instance details

Defined in Control.Effect.Internal.Cont

Methods

liftBase :: b α -> ContC r m α #

MonadTrans (ContC s) Source # 
Instance details

Defined in Control.Effect.Internal.Cont

Methods

lift :: Monad m => m a -> ContC s m a #

Monad (ContC r m) Source # 
Instance details

Defined in Control.Effect.Internal.Cont

Methods

(>>=) :: ContC r m a -> (a -> ContC r m b) -> ContC r m b #

(>>) :: ContC r m a -> ContC r m b -> ContC r m b #

return :: a -> ContC r m a #

fail :: String -> ContC r m a #

Functor (ContC r m) Source # 
Instance details

Defined in Control.Effect.Internal.Cont

Methods

fmap :: (a -> b) -> ContC r m a -> ContC r m b #

(<$) :: a -> ContC r m b -> ContC r m a #

MonadFail m => MonadFail (ContC r m) Source # 
Instance details

Defined in Control.Effect.Internal.Cont

Methods

fail :: String -> ContC r m a #

Applicative (ContC r m) Source # 
Instance details

Defined in Control.Effect.Internal.Cont

Methods

pure :: a -> ContC r m a #

(<*>) :: ContC r m (a -> b) -> ContC r m a -> ContC r m b #

liftA2 :: (a -> b -> c) -> ContC r m a -> ContC r m b -> ContC r m c #

(*>) :: ContC r m a -> ContC r m b -> ContC r m b #

(<*) :: ContC r m a -> ContC r m b -> ContC r m a #

MonadIO m => MonadIO (ContC r m) Source # 
Instance details

Defined in Control.Effect.Internal.Cont

Methods

liftIO :: IO a -> ContC r m a #

MonadThrow m => MonadThrow (ContC r m) Source # 
Instance details

Defined in Control.Effect.Internal.Cont

Methods

throwM :: Exception e => e -> ContC r m a #

MonadCatch m => MonadCatch (ContC r m) Source # 
Instance details

Defined in Control.Effect.Internal.Cont

Methods

catch :: Exception e => ContC r m a -> (e -> ContC r m a) -> ContC r m a #

(Carrier m, Threads (FreeT (ContBase (m r))) (Prims m)) => Carrier (ContC r m) Source # 
Instance details

Defined in Control.Effect.Internal.Cont

Associated Types

type Derivs (ContC r m) :: [Effect] Source #

type Prims (ContC r m) :: [Effect] Source #

Methods

algPrims :: Algebra' (Prims (ContC r m)) (ContC r m) a Source #

reformulate :: Monad z => Reformulation' (Derivs (ContC r m)) (Prims (ContC r m)) (ContC r m) z a Source #

algDerivs :: Algebra' (Derivs (ContC r m)) (ContC r m) a Source #

type Derivs (ContC r m) Source # 
Instance details

Defined in Control.Effect.Internal.Cont

type Derivs (ContC r m) = Cont ': Derivs m
type Prims (ContC r m) Source # 
Instance details

Defined in Control.Effect.Internal.Cont

type Prims (ContC r m) = Prims m

newtype ContFastC (r :: *) m a Source #

Constructors

ContFastC 

Fields

Instances
MonadBase b m => MonadBase b (ContFastC r m) Source # 
Instance details

Defined in Control.Effect.Internal.Cont

Methods

liftBase :: b α -> ContFastC r m α #

MonadTrans (ContFastC r) Source # 
Instance details

Defined in Control.Effect.Internal.Cont

Methods

lift :: Monad m => m a -> ContFastC r m a #

Monad (ContFastC r m) Source # 
Instance details

Defined in Control.Effect.Internal.Cont

Methods

(>>=) :: ContFastC r m a -> (a -> ContFastC r m b) -> ContFastC r m b #

(>>) :: ContFastC r m a -> ContFastC r m b -> ContFastC r m b #

return :: a -> ContFastC r m a #

fail :: String -> ContFastC r m a #

Functor (ContFastC r m) Source # 
Instance details

Defined in Control.Effect.Internal.Cont

Methods

fmap :: (a -> b) -> ContFastC r m a -> ContFastC r m b #

(<$) :: a -> ContFastC r m b -> ContFastC r m a #

MonadFail m => MonadFail (ContFastC r m) Source # 
Instance details

Defined in Control.Effect.Internal.Cont

Methods

fail :: String -> ContFastC r m a #

Applicative (ContFastC r m) Source # 
Instance details

Defined in Control.Effect.Internal.Cont

Methods

pure :: a -> ContFastC r m a #

(<*>) :: ContFastC r m (a -> b) -> ContFastC r m a -> ContFastC r m b #

liftA2 :: (a -> b -> c) -> ContFastC r m a -> ContFastC r m b -> ContFastC r m c #

(*>) :: ContFastC r m a -> ContFastC r m b -> ContFastC r m b #

(<*) :: ContFastC r m a -> ContFastC r m b -> ContFastC r m a #

MonadIO m => MonadIO (ContFastC r m) Source # 
Instance details

Defined in Control.Effect.Internal.Cont

Methods

liftIO :: IO a -> ContFastC r m a #

(Carrier m, Threads (ContT r) (Prims m)) => Carrier (ContFastC r m) Source # 
Instance details

Defined in Control.Effect.Internal.Cont

Associated Types

type Derivs (ContFastC r m) :: [Effect] Source #

type Prims (ContFastC r m) :: [Effect] Source #

type Derivs (ContFastC r m) Source # 
Instance details

Defined in Control.Effect.Internal.Cont

type Derivs (ContFastC r m) = Cont ': Derivs m
type Prims (ContFastC r m) Source # 
Instance details

Defined in Control.Effect.Internal.Cont

type Prims (ContFastC r m) = Prims m

newtype ShiftC r m a Source #

Constructors

ShiftC 

Fields

Instances
MonadBase b m => MonadBase b (ShiftC r m) Source # 
Instance details

Defined in Control.Effect.Internal.Cont

Methods

liftBase :: b α -> ShiftC r m α #

MonadTrans (ShiftC s) Source # 
Instance details

Defined in Control.Effect.Internal.Cont

Methods

lift :: Monad m => m a -> ShiftC s m a #

Monad (ShiftC r m) Source # 
Instance details

Defined in Control.Effect.Internal.Cont

Methods

(>>=) :: ShiftC r m a -> (a -> ShiftC r m b) -> ShiftC r m b #

(>>) :: ShiftC r m a -> ShiftC r m b -> ShiftC r m b #

return :: a -> ShiftC r m a #

fail :: String -> ShiftC r m a #

Functor (ShiftC r m) Source # 
Instance details

Defined in Control.Effect.Internal.Cont

Methods

fmap :: (a -> b) -> ShiftC r m a -> ShiftC r m b #

(<$) :: a -> ShiftC r m b -> ShiftC r m a #

MonadFail m => MonadFail (ShiftC r m) Source # 
Instance details

Defined in Control.Effect.Internal.Cont

Methods

fail :: String -> ShiftC r m a #

Applicative (ShiftC r m) Source # 
Instance details

Defined in Control.Effect.Internal.Cont

Methods

pure :: a -> ShiftC r m a #

(<*>) :: ShiftC r m (a -> b) -> ShiftC r m a -> ShiftC r m b #

liftA2 :: (a -> b -> c) -> ShiftC r m a -> ShiftC r m b -> ShiftC r m c #

(*>) :: ShiftC r m a -> ShiftC r m b -> ShiftC r m b #

(<*) :: ShiftC r m a -> ShiftC r m b -> ShiftC r m a #

MonadIO m => MonadIO (ShiftC r m) Source # 
Instance details

Defined in Control.Effect.Internal.Cont

Methods

liftIO :: IO a -> ShiftC r m a #

MonadThrow m => MonadThrow (ShiftC r m) Source # 
Instance details

Defined in Control.Effect.Internal.Cont

Methods

throwM :: Exception e => e -> ShiftC r m a #

MonadCatch m => MonadCatch (ShiftC r m) Source # 
Instance details

Defined in Control.Effect.Internal.Cont

Methods

catch :: Exception e => ShiftC r m a -> (e -> ShiftC r m a) -> ShiftC r m a #

(Carrier m, Threads (FreeT (ContBase (m r))) (Prims m)) => Carrier (ShiftC r m) Source # 
Instance details

Defined in Control.Effect.Internal.Cont

Associated Types

type Derivs (ShiftC r m) :: [Effect] Source #

type Prims (ShiftC r m) :: [Effect] Source #

Methods

algPrims :: Algebra' (Prims (ShiftC r m)) (ShiftC r m) a Source #

reformulate :: Monad z => Reformulation' (Derivs (ShiftC r m)) (Prims (ShiftC r m)) (ShiftC r m) z a Source #

algDerivs :: Algebra' (Derivs (ShiftC r m)) (ShiftC r m) a Source #

type Derivs (ShiftC r m) Source # 
Instance details

Defined in Control.Effect.Internal.Cont

type Derivs (ShiftC r m) = Shift r ': Derivs m
type Prims (ShiftC r m) Source # 
Instance details

Defined in Control.Effect.Internal.Cont

type Prims (ShiftC r m) = Prims m

newtype ShiftFastC (r :: *) m a Source #

Constructors

ShiftFastC 

Fields

Instances
MonadBase b m => MonadBase b (ShiftFastC r m) Source # 
Instance details

Defined in Control.Effect.Internal.Cont

Methods

liftBase :: b α -> ShiftFastC r m α #

MonadTrans (ShiftFastC r) Source # 
Instance details

Defined in Control.Effect.Internal.Cont

Methods

lift :: Monad m => m a -> ShiftFastC r m a #

Monad (ShiftFastC r m) Source # 
Instance details

Defined in Control.Effect.Internal.Cont

Methods

(>>=) :: ShiftFastC r m a -> (a -> ShiftFastC r m b) -> ShiftFastC r m b #

(>>) :: ShiftFastC r m a -> ShiftFastC r m b -> ShiftFastC r m b #

return :: a -> ShiftFastC r m a #

fail :: String -> ShiftFastC r m a #

Functor (ShiftFastC r m) Source # 
Instance details

Defined in Control.Effect.Internal.Cont

Methods

fmap :: (a -> b) -> ShiftFastC r m a -> ShiftFastC r m b #

(<$) :: a -> ShiftFastC r m b -> ShiftFastC r m a #

MonadFail m => MonadFail (ShiftFastC r m) Source # 
Instance details

Defined in Control.Effect.Internal.Cont

Methods

fail :: String -> ShiftFastC r m a #

Applicative (ShiftFastC r m) Source # 
Instance details

Defined in Control.Effect.Internal.Cont

Methods

pure :: a -> ShiftFastC r m a #

(<*>) :: ShiftFastC r m (a -> b) -> ShiftFastC r m a -> ShiftFastC r m b #

liftA2 :: (a -> b -> c) -> ShiftFastC r m a -> ShiftFastC r m b -> ShiftFastC r m c #

(*>) :: ShiftFastC r m a -> ShiftFastC r m b -> ShiftFastC r m b #

(<*) :: ShiftFastC r m a -> ShiftFastC r m b -> ShiftFastC r m a #

MonadIO m => MonadIO (ShiftFastC r m) Source # 
Instance details

Defined in Control.Effect.Internal.Cont

Methods

liftIO :: IO a -> ShiftFastC r m a #

(Carrier m, Threads (ContT r) (Prims m)) => Carrier (ShiftFastC r m) Source # 
Instance details

Defined in Control.Effect.Internal.Cont

Associated Types

type Derivs (ShiftFastC r m) :: [Effect] Source #

type Prims (ShiftFastC r m) :: [Effect] Source #

type Derivs (ShiftFastC r m) Source # 
Instance details

Defined in Control.Effect.Internal.Cont

type Derivs (ShiftFastC r m) = Shift r ': Derivs m
type Prims (ShiftFastC r m) Source # 
Instance details

Defined in Control.Effect.Internal.Cont

type Prims (ShiftFastC r m) = Prims m

type ContThreads = FreeThreads Source #

ContThreads accepts the following primitive effects:

class (forall s. Threads (ContT s) p) => ContFastThreads p Source #

ContFastThreads accepts the following primitive effects:

Instances
(forall s. Threads (ContT s) p) => ContFastThreads p Source # 
Instance details

Defined in Control.Effect.Internal.Cont