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

Safe HaskellNone




data ConLiftInfo Source #

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




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

Given an name of datatype or some of it's constructors/fields, return datatype's name together with info about it's 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.

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

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

pattern (:->) :: Type -> Type -> Type infixr 1 Source #

Pattern constructing function type and matching on one that may contain type annotations on arrow itself.