derive-0.1.2: A program and library to derive instances for data typesSource codeContentsIndex
Data.DeriveTraversal
Description
Derives Functor and similair classes, as discussed on the Haskell-prime mailing list: http://www.mail-archive.com/haskell-prime@haskell.org/msg02116.html.
Synopsis
data TraveralType = TraveralType {
traversalArg :: Int
traversalCo :: Bool
traversalName :: String
traversalId :: Trav
traversalDirect :: Trav
traversalFunc :: String -> Trav -> Trav
traversalPlus :: Trav -> Trav -> Trav
traverseArrow :: Trav -> Trav -> Trav
traverseTuple :: [Exp] -> Exp
traverseCtor :: String -> [Exp] -> Exp
traverseFunc :: Pat -> Exp -> Clause
}
defaultTraversalType
traversalDerivation1 :: TraveralType -> String -> Derivation
traversalInstance :: TraveralType -> String -> DataDef -> [WithInstances Dec] -> [Dec]
traversalInstance1 :: TraveralType -> String -> DataDef -> [Dec]
deriveTraversal :: TraveralType -> DataDef -> WithInstances Dec
Documentation
data TraveralType Source
What kind of traversal are we deriving?
Constructors
TraveralType
traversalArg :: IntOn what position are we traversing?
traversalCo :: Boolcovariant?
traversalName :: Stringname of the traversal function
traversalId :: TravIdentity traversal
traversalDirect :: TravTraversal of a
traversalFunc :: String -> Trav -> TravApply the sub-traversal function
traversalPlus :: Trav -> Trav -> TravApply two non-identity traversals in sequence
traverseArrow :: Trav -> Trav -> TravTraverse a function type
traverseTuple :: [Exp] -> ExpConstruct a tuple from applied traversals
traverseCtor :: String -> [Exp] -> ExpConstruct a data type from applied traversals
traverseFunc :: Pat -> Exp -> ClauseConstruct a clause of the traversal function
defaultTraversalType
traversalDerivation1 :: TraveralType -> String -> DerivationSource
Derivation for a Traversable like class with just 1 method
traversalInstance :: TraveralType -> String -> DataDef -> [WithInstances Dec] -> [Dec]Source
Instance for a Traversable like class
traversalInstance1 :: TraveralType -> String -> DataDef -> [Dec]Source
Instance for a Traversable like class with just 1 method
deriveTraversal :: TraveralType -> DataDef -> WithInstances DecSource
Derive a traverse like function
Produced by Haddock version 2.4.2