Hoogle Search
Within LTS Haskell 24.42 (ghc-9.10.3)
Note that Stackage only displays results for the latest LTS and Nightly snapshot. Learn more.
deriveRepresentable0 :: Name -> Q [Dec]generic-deriving Generics.Deriving.TH Given the type and the name (as string) for the Representable0 type synonym to derive, generate the Representable0 instance.
deriveRepresentable0Options :: Options -> Name -> Q [Dec]generic-deriving Generics.Deriving.TH Like deriveRepresentable0, but takes an Options argument.
deriveRepresentable1 :: Name -> Q [Dec]generic-deriving Generics.Deriving.TH Given the type and the name (as string) for the Representable1 type synonym to derive, generate the Representable1 instance.
deriveRepresentable1Options :: Options -> Name -> Q [Dec]generic-deriving Generics.Deriving.TH Like deriveRepresentable1, but takes an Options argument.
deriveSelectors :: Name -> Q [Dec]generic-deriving Generics.Deriving.TH Given a datatype name, derive datatypes and instances of class Selector. On GHC 7.11 and up, this functionality is no longer used in GHC generics, so this function generates no declarations.
-
th-lift Language.Haskell.TH.Lift No documentation available.
deriveLift' :: [Role] -> Info -> Q [Dec]th-lift Language.Haskell.TH.Lift Obtain Info values through a custom reification function. This is useful when generating instances for datatypes that have not yet been declared.
deriveLiftMany :: [Name] -> Q [Dec]th-lift Language.Haskell.TH.Lift Derive Lift instances for many datatypes.
deriveLiftMany' :: [([Role], Info)] -> Q [Dec]th-lift Language.Haskell.TH.Lift No documentation available.
deriveGeneric :: Name -> Q [Dec]generics-sop Generics.SOP.TH Generate generics-sop boilerplate for the given datatype. This function takes the name of a datatype and generates:
- a Code instance
- a Generic instance
- a HasDatatypeInfo instance
data Tree = Leaf Int | Node Tree Tree
and sayderiveGeneric ''Tree
then you get code that is equivalent to:instance Generic Tree where type Code Tree = '[ '[Int], '[Tree, Tree] ] from (Leaf x) = SOP ( Z (I x :* Nil)) from (Node l r) = SOP (S (Z (I l :* I r :* Nil))) to (SOP (Z (I x :* Nil))) = Leaf x to (SOP (S (Z (I l :* I r :* Nil)))) = Node l r to (SOP (S (S x))) = x `seq` error "inaccessible" instance HasDatatypeInfo Tree where type DatatypeInfoOf Tree = T.ADT "Main" "Tree" '[ T.Constructor "Leaf", T.Constructor "Node" ] datatypeInfo _ = T.demoteDatatypeInfo (Proxy :: Proxy (DatatypeInfoOf Tree))
Limitations: Generation does not work for GADTs, for datatypes that involve existential quantification, for datatypes with unboxed fields.