Safe Haskell | None |
---|---|
Language | Haskell2010 |
Synopsis
- class DeepPrisms e e' where
- hoist :: DeepPrisms e e' => e' -> e
- retrieve :: DeepPrisms e e' => e -> Maybe e'
- data Ctor = Ctor {}
- data SubError = SubError {}
- data PrismsInstance = PrismsInstance {}
- ctor :: ConstructorInfo -> Maybe Ctor
- dataType :: Name -> Q [Ctor]
- mkHoist :: TypeQ -> TypeQ -> BodyQ -> DecQ
- deepPrismsInstance :: TypeQ -> TypeQ -> BodyQ -> DecQ
- idInstance :: Name -> DecQ
- typeHasDeepPrisms :: Ctor -> Q Bool
- modName :: NameFlavour -> Maybe ModName
- sameModule :: NameFlavour -> NameFlavour -> Bool
- prismFlavour :: NameFlavour -> NameFlavour
- prismName :: Name -> Name -> ExpQ
- constructorPrism :: Name -> [Name] -> Ctor -> Q PrismsInstance
- filterDuplicates :: [Ctor] -> [PrismsInstance] -> [PrismsInstance]
- deepPrismCtors :: Name -> Q [Ctor]
- basicPrisms :: Name -> DecsQ
- prismsForData :: Name -> [Name] -> Name -> Q [PrismsInstance]
- prismsForMainData :: Name -> DecsQ
- deepPrisms :: Name -> DecsQ
Documentation
hoist :: DeepPrisms e e' => e' -> e Source #
retrieve :: DeepPrisms e e' => e -> Maybe e' Source #
data PrismsInstance Source #
Instances
Eq PrismsInstance Source # | |
Defined in Data.DeepPrisms (==) :: PrismsInstance -> PrismsInstance -> Bool # (/=) :: PrismsInstance -> PrismsInstance -> Bool # | |
Show PrismsInstance Source # | |
Defined in Data.DeepPrisms showsPrec :: Int -> PrismsInstance -> ShowS # show :: PrismsInstance -> String # showList :: [PrismsInstance] -> ShowS # |
idInstance :: Name -> DecQ Source #
sameModule :: NameFlavour -> NameFlavour -> Bool Source #
prismFlavour :: NameFlavour -> NameFlavour Source #
Convert a constructor's NameFlavour to one for a prism The NameSpace field is DataName for the constructor and must be VarName Curiously, this only surfaces as a bug when having a certain nesting level across modules
constructorPrism :: Name -> [Name] -> Ctor -> Q PrismsInstance Source #
filterDuplicates :: [Ctor] -> [PrismsInstance] -> [PrismsInstance] Source #
basicPrisms :: Name -> DecsQ Source #
prismsForData :: Name -> [Name] -> Name -> Q [PrismsInstance] Source #
prismsForMainData :: Name -> DecsQ Source #
deepPrisms :: Name -> DecsQ Source #