| Safe Haskell | None |
|---|---|
| Language | Haskell2010 |
Polysemy.Internal.TH.Common
Synopsis
- data ConLiftInfo = CLInfo {
- cliEffName :: Name
- cliEffArgs :: [Type]
- cliResType :: Type
- cliConName :: Name
- cliFunName :: Name
- cliFunFixity :: Maybe Fixity
- cliArgs :: [(Name, Type)]
- cliFunCxt :: Cxt
- cliUnionName :: Name
- getEffectMetadata :: Name -> Q (DatatypeInfo, [ConLiftInfo])
- makeMemberConstraint :: Name -> ConLiftInfo -> Pred
- makeMemberConstraint' :: Name -> Type -> Pred
- makeSemType :: Name -> Type -> Type
- makeInterpreterType :: ConLiftInfo -> Name -> Type -> Type
- makeEffectType :: ConLiftInfo -> Type
- makeUnambiguousSend :: Bool -> ConLiftInfo -> Exp
- checkExtensions :: [Extension] -> Q ()
- foldArrows :: Type -> [Type] -> Type
Documentation
data ConLiftInfo Source #
Info about constructor being lifted; use mkCLInfo to create one.
Constructors
| CLInfo | |
Fields
| |
Instances
| Show ConLiftInfo Source # | |
Defined in Polysemy.Internal.TH.Common Methods showsPrec :: Int -> ConLiftInfo -> ShowS # show :: ConLiftInfo -> String # showList :: [ConLiftInfo] -> ShowS # | |
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 #
will produce a makeMemberConstraint' r typeMember type r
constraint.
makeSemType :: Name -> Type -> Type Source #
will produce a makeSemType r a type.Sem r a
makeInterpreterType :: ConLiftInfo -> Name -> Type -> Type Source #
will produce a makeInterpreterType con r a type, where Sem (Effect ':
r) a -> Sem r aEffect 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 #