cleff-0.2.0.0: Fast and concise extensible effects
Copyright(c) 2021 Xy Ren
LicenseBSD3
Maintainerxy.r@outlook.com
Stabilityunstable
Portabilitynon-portable (GHC only)
Safe HaskellNone
LanguageHaskell2010

Cleff.Internal.Effect

Description

This module contains definitions of some basic types related to effects. You won't need this module directly; these functionalities are reexported in the Cleff module.

This is an internal module and its API may change even between minor versions. Therefore you should be extra careful if you're to depend on this module.

Synopsis

Documentation

type Effect = (Type -> Type) -> Type -> Type Source #

The type of effects. An effect e m a takes an effect monad type m :: Type -> Type and a result type a :: Type.

type (:>) = Elem infix 0 Source #

e :> es means the effect e is present in the effect stack es, and therefore can be used in an Eff es computation.

type family xs :>> es :: Constraint where ... infix 0 Source #

xs :>> es means the list of effects xs are all present in the effect stack es. This is a convenient type alias for (e1 :> es, ..., en :> es).

Equations

'[] :>> _ = () 
(x ': xs) :>> es = (x :> es, xs :>> es) 

type family (xs :: [a]) ++ (ys :: [a]) :: [a] where ... infixr 5 #

Type level list concatenation.

Equations

('[] :: [a]) ++ (ys :: [a]) = ys 
(x ': xs :: [a]) ++ (ys :: [a]) = x ': (xs ++ ys) 

type (~>) (f :: k -> Type) (g :: k -> Type) = forall (a :: k). f a -> g a infixr 0 #

The type of natural transformations from functor f to g.