Copyright | (c) 2023-2024 Yamada Ryo (c) 2010-2011 Patrick Bahr Tom Hvitved (c) 2020 Michael Szvetits |
---|---|
License | MPL-2.0 (see the file LICENSE) |
Maintainer | ymdfield@outlook.jp |
Stability | experimental |
Portability | portable |
Safe Haskell | Safe-Inferred |
Language | GHC2021 |
Synopsis
- data EffClsInfo = EffClsInfo {
- ecName :: Name
- ecParamVars :: [TyVarBndr ()]
- ecCarrier :: Maybe (TyVarBndr ())
- ecEffs :: [EffConInfo]
- data EffConInfo = EffConInfo {
- effName :: Name
- effParamTypes :: [Type]
- effDataType :: Type
- effResultType :: Type
- effTyVars :: [TyVarBndrSpec]
- effCarrier :: Maybe (TyVarBndr ())
- effCxt :: Cxt
- data EffectOrder
- orderOf :: EffClsInfo -> EffectOrder
- newtype MakeEffectConf = MakeEffectConf {}
- alterEffectClassConf :: (EffectClassConf -> EffectClassConf) -> MakeEffectConf -> MakeEffectConf
- alterEffectConf :: (EffectConf -> EffectConf) -> MakeEffectConf -> MakeEffectConf
- data EffectClassConf = EffectClassConf {}
- data EffectConf = EffectConf {}
- data SenderFunctionConf = SenderFunctionConf {
- _senderFnName :: String
- _doesGenerateSenderFnSignature :: Bool
- _senderFnDoc :: Maybe String -> Q (Maybe String)
- _senderFnArgDoc :: Int -> Maybe String -> Q (Maybe String)
- senderFnConfs :: Traversal' EffectConf SenderFunctionConf
- doesGenerateLiftInsTypeSynonym :: Lens' EffectClassConf Bool
- doesGenerateLiftInsPatternSynonyms :: Lens' EffectClassConf Bool
- doesDeriveHFunctor :: Lens' EffectClassConf Bool
- confByEffect :: Lens' EffectClassConf (Name -> EffectConf)
- warnFirstOrderInSigCls :: Lens' EffectConf Bool
- taggedSenderGenConf :: Lens' EffectConf (Maybe SenderFunctionConf)
- normalSenderGenConf :: Lens' EffectConf (Maybe SenderFunctionConf)
- keyedSenderGenConf :: Lens' EffectConf (Maybe SenderFunctionConf)
- senderFnName :: Lens' SenderFunctionConf String
- senderFnDoc :: Lens' SenderFunctionConf (Maybe String -> Q (Maybe String))
- senderFnArgDoc :: Lens' SenderFunctionConf (Int -> Maybe String -> Q (Maybe String))
- doesGenerateSenderFnSignature :: Lens' SenderFunctionConf Bool
- deriveHFunctor :: MakeEffectConf -> MakeEffectConf
- noDeriveHFunctor :: MakeEffectConf -> MakeEffectConf
- generateLiftInsTypeSynonym :: MakeEffectConf -> MakeEffectConf
- noGenerateLiftInsTypeSynonym :: MakeEffectConf -> MakeEffectConf
- generateLiftInsPatternSynonyms :: MakeEffectConf -> MakeEffectConf
- noGenerateLiftInsPatternSynonyms :: MakeEffectConf -> MakeEffectConf
- noGenerateNormalSenderFunction :: MakeEffectConf -> MakeEffectConf
- noGenerateTaggedSenderFunction :: MakeEffectConf -> MakeEffectConf
- noGenerateKeyedSenderFunction :: MakeEffectConf -> MakeEffectConf
- suppressFirstOrderInSignatureClassWarning :: MakeEffectConf -> MakeEffectConf
- noGenerateSenderFunctionSignature :: MakeEffectConf -> MakeEffectConf
- genSenders :: EffectClassConf -> EffClsInfo -> Q [Dec]
- genNormalSender :: EffectOrder -> SenderFunctionConf -> EffConInfo -> WriterT [Dec] Q ()
- genTaggedSender :: EffectOrder -> SenderFunctionConf -> EffConInfo -> WriterT [Dec] Q ()
- genKeyedSender :: EffectOrder -> SenderFunctionConf -> EffConInfo -> WriterT [Dec] Q ()
- genSender :: EffectOrder -> (Exp -> Exp) -> (Type -> Type -> Type) -> ([TyVarBndrSpec] -> [TyVarBndrSpec]) -> SenderFunctionConf -> EffConInfo -> WriterT [Dec] Q ()
- genSenderArmor :: (Type -> Type -> Type) -> ([TyVarBndrSpec] -> [TyVarBndrSpec]) -> SenderFunctionConf -> EffConInfo -> (Type -> Q Clause) -> WriterT [Dec] Q ()
- arrowChain :: Foldable t => t Type -> Type -> Type
- data DataInfo = DataInfo {}
- data ConInfo = ConInfo {}
- reifyEffCls :: EffectOrder -> Name -> Q (Info, DataInfo, EffClsInfo)
- analyzeEffCls :: EffectOrder -> DataInfo -> Either Text EffClsInfo
- genLiftInsPatternSynonyms :: EffClsInfo -> Q [Dec]
- genLiftInsTypeSynonym :: EffClsInfo -> Dec
- tyVarName :: TyVarBndr a -> Name
- tyVarType :: TyVarBndr a -> Type
- unkindTypeRec :: Type -> Type
- unkindType :: Type -> Type
- unkindTyVar :: TyVarBndr a -> TyVarBndr a
- occurs :: Name -> Type -> Bool
- analyzeData :: Info -> Maybe DataInfo
- normalizeCon :: Con -> [ConInfo]
- normalizeNonForallCon :: Con -> [ConInfo]
Documentation
data EffClsInfo Source #
EffClsInfo | |
|
data EffConInfo Source #
EffConInfo | |
|
data EffectOrder Source #
An order of effect.
Instances
Show EffectOrder Source # | |
Defined in Data.Effect.TH.Internal showsPrec :: Int -> EffectOrder -> ShowS # show :: EffectOrder -> String # showList :: [EffectOrder] -> ShowS # | |
Eq EffectOrder Source # | |
Defined in Data.Effect.TH.Internal (==) :: EffectOrder -> EffectOrder -> Bool # (/=) :: EffectOrder -> EffectOrder -> Bool # | |
Ord EffectOrder Source # | |
Defined in Data.Effect.TH.Internal compare :: EffectOrder -> EffectOrder -> Ordering # (<) :: EffectOrder -> EffectOrder -> Bool # (<=) :: EffectOrder -> EffectOrder -> Bool # (>) :: EffectOrder -> EffectOrder -> Bool # (>=) :: EffectOrder -> EffectOrder -> Bool # max :: EffectOrder -> EffectOrder -> EffectOrder # min :: EffectOrder -> EffectOrder -> EffectOrder # |
orderOf :: EffClsInfo -> EffectOrder Source #
newtype MakeEffectConf Source #
Instances
Default MakeEffectConf Source # | |
Defined in Data.Effect.TH.Internal def :: MakeEffectConf # |
alterEffectClassConf :: (EffectClassConf -> EffectClassConf) -> MakeEffectConf -> MakeEffectConf Source #
alterEffectConf :: (EffectConf -> EffectConf) -> MakeEffectConf -> MakeEffectConf Source #
data EffectClassConf Source #
Instances
Default EffectClassConf Source # | |
Defined in Data.Effect.TH.Internal def :: EffectClassConf # |
data EffectConf Source #
data SenderFunctionConf Source #
SenderFunctionConf | |
|
confByEffect :: Lens' EffectClassConf (Name -> EffectConf) Source #
senderFnDoc :: Lens' SenderFunctionConf (Maybe String -> Q (Maybe String)) Source #
genSenders :: EffectClassConf -> EffClsInfo -> Q [Dec] Source #
genNormalSender :: EffectOrder -> SenderFunctionConf -> EffConInfo -> WriterT [Dec] Q () Source #
genTaggedSender :: EffectOrder -> SenderFunctionConf -> EffConInfo -> WriterT [Dec] Q () Source #
genKeyedSender :: EffectOrder -> SenderFunctionConf -> EffConInfo -> WriterT [Dec] Q () Source #
genSender :: EffectOrder -> (Exp -> Exp) -> (Type -> Type -> Type) -> ([TyVarBndrSpec] -> [TyVarBndrSpec]) -> SenderFunctionConf -> EffConInfo -> WriterT [Dec] Q () Source #
genSenderArmor :: (Type -> Type -> Type) -> ([TyVarBndrSpec] -> [TyVarBndrSpec]) -> SenderFunctionConf -> EffConInfo -> (Type -> Q Clause) -> WriterT [Dec] Q () Source #
A reified information of a datatype.
reifyEffCls :: EffectOrder -> Name -> Q (Info, DataInfo, EffClsInfo) Source #
analyzeEffCls :: EffectOrder -> DataInfo -> Either Text EffClsInfo Source #
Generating Synonyms about LiftIns
genLiftInsPatternSynonyms :: EffClsInfo -> Q [Dec] Source #
Generate the pattern synonyms for instruction constructors:
pattern LBaz ... = LiftIns (Baz ...)
genLiftInsTypeSynonym :: EffClsInfo -> Dec Source #
Generate the type synonym for an instruction class datatype:
type (LFoobar ...) = LiftIns (Foobar ...)
Utility functions
unkindTypeRec :: Type -> Type Source #
Throws away all kind information from a type.
unkindType :: Type -> Type Source #
unkindTyVar :: TyVarBndr a -> TyVarBndr a Source #
Throws away the kind information of a type variable.
analyzeData :: Info -> Maybe DataInfo Source #
This function abstracts away newtype
declaration, it turns them into
data
declarations.
normalizeCon :: Con -> [ConInfo] Source #
normalizeNonForallCon :: Con -> [ConInfo] Source #