polysemy- Higher-order, low-boilerplate, zero-cost free monads.

Safe HaskellNone




data ConLiftInfo Source #

Info about constructor being lifted; use mkCLInfo to create one.




getEffectMetadata :: Name -> Q (DatatypeInfo, [ConLiftInfo]) Source #

Given an effect name, eg ''State, get information about the type constructor, and about each of its data constructors.

makeMemberConstraint :: Name -> ConLiftInfo -> Pred Source #

Turn a ConLiftInfo for Foo into a Member Foo r constraint.

makeMemberConstraint' :: Name -> Type -> Pred Source #

makeMemberConstraint' r type will produce a Member type r constraint.

makeSemType :: Name -> Type -> Type Source #

makeSemType r a will produce a Sem r a type.

makeInterpreterType :: ConLiftInfo -> Name -> Type -> Type Source #

makeInterpreterType con r a will produce a Sem (Effect ': r) a -> Sem r a type, where Effect is the effect corresponding to the ConLiftInfo for con.

makeEffectType :: ConLiftInfo -> Type Source #

Given a ConLiftInfo, get the corresponding effect type.

makeUnambiguousSend :: Bool -> ConLiftInfo -> Exp Source #

Given a ConLiftInfo, this will produce an action for it. It's arguments will come from any variables in scope that correspond to the cliArgs of the ConLiftInfo.

checkExtensions :: [Extension] -> Q () Source #

Fail the Q monad whenever the given Extensions aren't enabled in the current module.

foldArrows :: Type -> [Type] -> Type Source #

Folds a list of Types into a right-associative arrow Type.