| Safe Haskell | None | 
|---|---|
| Language | Haskell2010 | 
Polysemy.Internal.TH.Common
Synopsis
- data ConLiftInfo = CLInfo {- cliEffName :: Name
- cliEffArgs :: [Type]
- cliEffRes :: Type
- cliConName :: Name
- cliFunName :: Name
- cliFunFixity :: Maybe Fixity
- cliFunArgs :: [(Name, Type)]
- cliFunCxt :: Cxt
- cliUnionName :: Name
 
- getEffectMetadata :: Name -> Q (Name, [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 ()
- foldArrowTs :: Type -> [Type] -> Type
- splitArrowTs :: Type -> [Type]
- pattern (:->) :: Type -> Type -> Type
Documentation
data ConLiftInfo Source #
Info about constructor being lifted; use makeCLInfo 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 (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 typeMember type r
 constraint.
makeSemType :: Name -> Type -> Type Source #
makeSemType r aSem r a
makeInterpreterType :: ConLiftInfo -> Name -> Type -> Type Source #
makeInterpreterType con r aSem (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 #
splitArrowTs :: Type -> [Type] Source #