Copyright | (c) 2023-2024 Sayo Koyoneda (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 | None |
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
- confByEffect :: Lens' EffectClassConf (Name -> EffectConf)
- doesDeriveHFunctor :: Lens' EffectClassConf Bool
- doesGenerateLiftFOEPatternSynonyms :: Lens' EffectClassConf Bool
- doesGenerateLiftFOETypeSynonym :: Lens' EffectClassConf Bool
- keyedSenderGenConf :: Lens' EffectConf (Maybe SenderFunctionConf)
- normalSenderGenConf :: Lens' EffectConf (Maybe SenderFunctionConf)
- taggedSenderGenConf :: Lens' EffectConf (Maybe SenderFunctionConf)
- warnFirstOrderInHOE :: Lens' EffectConf Bool
- doesGenerateSenderFnSignature :: Lens' SenderFunctionConf Bool
- senderFnArgDoc :: Lens' SenderFunctionConf (Int -> Maybe String -> Q (Maybe String))
- senderFnDoc :: Lens' SenderFunctionConf (Maybe String -> Q (Maybe String))
- senderFnName :: Lens' SenderFunctionConf String
- deriveHFunctor :: MakeEffectConf -> MakeEffectConf
- noDeriveHFunctor :: MakeEffectConf -> MakeEffectConf
- generateLiftFOETypeSynonym :: MakeEffectConf -> MakeEffectConf
- noGenerateLiftFOETypeSynonym :: MakeEffectConf -> MakeEffectConf
- generateLiftFOEPatternSynonyms :: MakeEffectConf -> MakeEffectConf
- noGenerateLiftFOEPatternSynonyms :: MakeEffectConf -> MakeEffectConf
- noGenerateNormalSenderFunction :: MakeEffectConf -> MakeEffectConf
- noGenerateTaggedSenderFunction :: MakeEffectConf -> MakeEffectConf
- noGenerateKeyedSenderFunction :: MakeEffectConf -> MakeEffectConf
- suppressFirstOrderInHigherOrderEffectWarning :: 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
- genLiftFOEPatternSynonyms :: EffClsInfo -> Q [Dec]
- genLiftFOETypeSynonym :: 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 LiftFOE
genLiftFOEPatternSynonyms :: EffClsInfo -> Q [Dec] Source #
Generate the pattern synonyms for operation constructors:
pattern LBaz ... = LiftFOE (Baz ...)
genLiftFOETypeSynonym :: EffClsInfo -> Dec Source #
Generate the type synonym for an first-order effect datatype:
type (LFoobar ...) = LiftFOE (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 #