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.

  1. 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.

  2. deriveRepresentable0Options :: Options -> Name -> Q [Dec]

    generic-deriving Generics.Deriving.TH

    Like deriveRepresentable0, but takes an Options argument.

  3. 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.

  4. deriveRepresentable1Options :: Options -> Name -> Q [Dec]

    generic-deriving Generics.Deriving.TH

    Like deriveRepresentable1, but takes an Options argument.

  5. 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.

  6. deriveLift :: Name -> Q [Dec]

    th-lift Language.Haskell.TH.Lift

    No documentation available.

  7. 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.

  8. deriveLiftMany :: [Name] -> Q [Dec]

    th-lift Language.Haskell.TH.Lift

    Derive Lift instances for many datatypes.

  9. deriveLiftMany' :: [([Role], Info)] -> Q [Dec]

    th-lift Language.Haskell.TH.Lift

    No documentation available.

  10. 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:

    Note that the generated code will require the TypeFamilies and DataKinds extensions to be enabled for the module. Example: If you have the datatype
    data Tree = Leaf Int | Node Tree Tree
    
    and say
    deriveGeneric ''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.

Page 7 of many | Previous | Next