lens-3.8.7.3: Lenses, Folds and Traversals

PortabilityTemplateHaskell
Stabilityexperimental
MaintainerEdward Kmett <ekmett@gmail.com>
Safe HaskellTrustworthy

Language.Haskell.TH.Lens

Description

Lenses and Traversals for working with Template Haskell

Synopsis

Documentation

class HasName t where

Has a Name

Methods

name :: Lens' t Name

Extract (or modify) the Name of something

class HasTypeVars t where

Provides for the extraction of free type variables, and alpha renaming.

Methods

typeVarsEx :: Set Name -> Traversal' t Name

When performing substitution into this traversal you're not allowed to substitute in a name that is bound internally or you'll violate the Traversal laws, when in doubt generate your names with newName.

class SubstType t where

Provides substitution for types

Methods

substType :: Map Name Type -> t -> t

Perform substitution for types

typeVars :: HasTypeVars t => Traversal' t Name

Traverse free type variables

substTypeVars :: HasTypeVars t => Map Name Name -> t -> t

Substitute using a map of names in for free type variables

conFields :: Traversal' Con StrictType

Provides a Traversal of the types of each field of a constructor.

conNamedFields :: Traversal' Con VarStrictType

Traversal of the types of the named fields of a constructor.