fused-effects-0.1.2.0: A fast, flexible, fused effect system.

Safe HaskellNone
LanguageHaskell2010

Control.Effect.Internal

Documentation

newtype Eff carrier a Source #

Constructors

Eff 

Fields

  • unEff :: forall x. (a -> carrier x) -> carrier x
     
Instances
Carrier sig carrier => Carrier sig (Eff carrier) Source # 
Instance details

Defined in Control.Effect.Internal

Methods

ret :: a -> Eff carrier a Source #

eff :: sig (Eff carrier) (Eff carrier a) -> Eff carrier a Source #

Monad (Eff carrier) Source # 
Instance details

Defined in Control.Effect.Internal

Methods

(>>=) :: Eff carrier a -> (a -> Eff carrier b) -> Eff carrier b #

(>>) :: Eff carrier a -> Eff carrier b -> Eff carrier b #

return :: a -> Eff carrier a #

fail :: String -> Eff carrier a #

Functor (Eff carrier) Source # 
Instance details

Defined in Control.Effect.Internal

Methods

fmap :: (a -> b) -> Eff carrier a -> Eff carrier b #

(<$) :: a -> Eff carrier b -> Eff carrier a #

(Member Fail sig, Carrier sig carrier) => MonadFail (Eff carrier) Source # 
Instance details

Defined in Control.Effect.Internal

Methods

fail :: String -> Eff carrier a #

Applicative (Eff carrier) Source # 
Instance details

Defined in Control.Effect.Internal

Methods

pure :: a -> Eff carrier a #

(<*>) :: Eff carrier (a -> b) -> Eff carrier a -> Eff carrier b #

liftA2 :: (a -> b -> c) -> Eff carrier a -> Eff carrier b -> Eff carrier c #

(*>) :: Eff carrier a -> Eff carrier b -> Eff carrier b #

(<*) :: Eff carrier a -> Eff carrier b -> Eff carrier a #

(Member (Lift IO) sig, Carrier sig carrier) => MonadIO (Eff carrier) Source # 
Instance details

Defined in Control.Effect.Internal

Methods

liftIO :: IO a -> Eff carrier a #

(Member NonDet sig, Carrier sig carrier) => Alternative (Eff carrier) Source #

Run computations nondeterministically.

run (runNonDet empty) == []
run (runNonDet empty) == Nothing
run (runNonDet (pure a <|> pure b)) == [a, b]
run (runNonDet (pure a <|> pure b)) == Just a

Associativity:

run (runNonDet ((pure a <|> pure b) <|> pure c)) == (run (runNonDet (pure a <|> (pure b <|> pure c))) :: [Integer])
run (runNonDet ((pure a <|> pure b) <|> pure c)) == (run (runNonDet (pure a <|> (pure b <|> pure c))) :: Maybe Integer)

Left-identity:

run (runNonDet (empty <|> pure b)) == (run (runNonDet (pure b)) :: [Integer])
run (runNonDet (empty <|> pure b)) == (run (runNonDet (pure b)) :: Maybe Integer)

Right-identity:

run (runNonDet (pure a <|> empty)) == (run (runNonDet (pure a)) :: [Integer])
run (runNonDet (pure a <|> empty)) == (run (runNonDet (pure a)) :: Maybe Integer)
Instance details

Defined in Control.Effect.Internal

Methods

empty :: Eff carrier a #

(<|>) :: Eff carrier a -> Eff carrier a -> Eff carrier a #

some :: Eff carrier a -> Eff carrier [a] #

many :: Eff carrier a -> Eff carrier [a] #

(Member NonDet sig, Carrier sig carrier) => MonadPlus (Eff carrier) Source # 
Instance details

Defined in Control.Effect.Internal

Methods

mzero :: Eff carrier a #

mplus :: Eff carrier a -> Eff carrier a -> Eff carrier a #

(Member Random sig, Carrier sig carrier) => MonadInterleave (Eff carrier) Source # 
Instance details

Defined in Control.Effect.Internal

Methods

interleave :: Eff carrier a -> Eff carrier a #

(Member Random sig, Carrier sig carrier) => MonadRandom (Eff carrier) Source # 
Instance details

Defined in Control.Effect.Internal

Methods

getRandomR :: Random a => (a, a) -> Eff carrier a #

getRandom :: Random a => Eff carrier a #

getRandomRs :: Random a => (a, a) -> Eff carrier [a] #

getRandoms :: Random a => Eff carrier [a] #

runEff :: (a -> carrier b) -> Eff carrier a -> carrier b Source #

interpret :: Carrier sig carrier => Eff carrier a -> carrier a Source #