lens-5.2.3: Lenses, Folds and Traversals

Copyright | (C) 2012-2016 Edward Kmett
License | BSD-style (see the file LICENSE)
Maintainer | Edward Kmett <ekmett@gmail.com>
Stability | experimental
Portability | TemplateHaskell
Safe Haskell | Trustworthy
Language | Haskell2010

Language.Haskell.TH.Lens

Contents

- Traversals
- Lenses
  - Loc Lenses
  - FunDep Lenses
  - Match Lenses
  - Fixity Lenses
  - Clause Lenses
  - FieldExp Lenses
  - FieldPat Lenses
  - TySynEqn Lenses
  - InjectivityAnn Lenses
  - TypeFamilyHead Lenses
  - Bang Lenses
  - DerivClause Lenses
- Prisms
  - Info Prisms
  - Dec Prisms
  - PatSynDir Prisms
  - PatSynArgs Prisms
  - Con Prisms
  - Overlap Prisms
  - SourceUnpackedness Prisms
  - SourceStrictness Prisms
  - DecidedStrictness Prisms
  - Foreign Prisms
  - Callconv Prisms
  - Safety Prisms
  - Pragma Prisms
  - Inline Prisms
  - RuleMatch Prisms
  - Phases Prisms
  - RuleBndr Prisms
  - AnnTarget Prisms
  - FunDep Prisms TODO make a lens
  - FixityDirection Prisms
  - Exp Prisms
  - Body Prisms
  - Guard Prisms
  - Stmt Prisms
  - Range Prisms
  - Lit Prisms
  - Pat Prisms
  - Type Prisms
  - Specificity Prisms
  - BndrVis Prisms
  - TyVarBndr Prisms
  - FamilyResultSig Prisms
  - TyLit Prisms
  - Role Prisms
  - DerivStrategy Prisms

Description

Lenses, Prisms, and Traversals for working with Template Haskell.

Beware that the API offered in this module is subject to change, as it mirrors the API exposed by the `template-haskell` package, which frequently changes between different releases of GHC. An effort is made to identify the functions in this module which have different type signatures when compiled with different versions of `template-haskell`.

Synopsis

- class HasName t where
  - name :: Lens' t Name
- class HasTypes t where
  - types :: Traversal' t Type
- class HasTypeVars t where
  - typeVarsEx :: Set Name -> Traversal' t Name
- class SubstType t where
  - substType :: Map Name Type -> t -> t
- typeVars :: HasTypeVars t => Traversal' t Name
- substTypeVars :: HasTypeVars t => Map Name Name -> t -> t
- conFields :: Traversal' Con BangType
- conNamedFields :: Traversal' Con VarBangType
- locFileName :: Lens' Loc String
- locPackage :: Lens' Loc String
- locModule :: Lens' Loc String
- locStart :: Lens' Loc CharPos
- locEnd :: Lens' Loc CharPos
- funDepInputs :: Lens' FunDep [Name]
- funDepOutputs :: Lens' FunDep [Name]
- matchPattern :: Lens' Match Pat
- matchBody :: Lens' Match Body
- matchDeclarations :: Lens' Match [Dec]
- fixityPrecedence :: Lens' Fixity Int
- fixityDirection :: Lens' Fixity FixityDirection
- clausePattern :: Lens' Clause [Pat]
- clauseBody :: Lens' Clause Body
- clauseDecs :: Lens' Clause [Dec]
- fieldExpName :: Lens' FieldExp Name
- fieldExpExpression :: Lens' FieldExp Exp
- fieldPatName :: Lens' FieldPat Name
- fieldPatPattern :: Lens' FieldPat Pat
- tySynEqnLHS :: Lens' TySynEqn Type
- tySynEqnPatterns :: Lens' TySynEqn [Type]
- tySynEqnResult :: Lens' TySynEqn Type
- injectivityAnnOutput :: Lens' InjectivityAnn Name
- injectivityAnnInputs :: Lens' InjectivityAnn [Name]
- typeFamilyHeadName :: Lens' TypeFamilyHead Name
- typeFamilyHeadTyVarBndrs :: Lens' TypeFamilyHead [TyVarBndrVis]
- typeFamilyHeadResultSig :: Lens' TypeFamilyHead FamilyResultSig
- typeFamilyHeadInjectivityAnn :: Lens' TypeFamilyHead (Maybe InjectivityAnn)
- bangSourceUnpackedness :: Lens' Bang SourceUnpackedness
- bangSourceStrictness :: Lens' Bang SourceStrictness
- derivClauseStrategy :: Lens' DerivClause (Maybe DerivStrategy)
- derivClauseCxt :: Lens' DerivClause Cxt
- _ClassI :: Prism' Info (Dec, [InstanceDec])
- _ClassOpI :: Prism' Info (Name, Type, ParentName)
- _TyConI :: Prism' Info Dec
- _FamilyI :: Prism' Info (Dec, [InstanceDec])
- _PrimTyConI :: Prism' Info (Name, Arity, Unlifted)
- _DataConI :: Prism' Info (Name, Type, ParentName)
- _VarI :: Prism' Info (Name, Type, Maybe Dec)
- _TyVarI :: Prism' Info (Name, Type)
- _PatSynI :: Prism' Info (Name, PatSynType)
- _FunD :: Prism' Dec (Name, [Clause])
- _ValD :: Prism' Dec (Pat, Body, [Dec])
- _DataD :: DataPrism' [TyVarBndrVis] [Con]
- _NewtypeD :: DataPrism' [TyVarBndrVis] Con
- _TySynD :: Prism' Dec (Name, [TyVarBndrVis], Type)
- _ClassD :: Prism' Dec (Cxt, Name, [TyVarBndrVis], [FunDep], [Dec])
- _InstanceD :: Prism' Dec (Maybe Overlap, Cxt, Type, [Dec])
- _SigD :: Prism' Dec (Name, Type)
- _ForeignD :: Prism' Dec Foreign
- _InfixD :: Prism' Dec (Fixity, Name)
- _PragmaD :: Prism' Dec Pragma
- _DataInstD :: Prism' Dec (Cxt, Maybe [TyVarBndrUnit], Type, Maybe Kind, [Con], [DerivClause])
- _NewtypeInstD :: Prism' Dec (Cxt, Maybe [TyVarBndrUnit], Type, Maybe Kind, Con, [DerivClause])
- _TySynInstD :: Prism' Dec TySynEqn
- _ClosedTypeFamilyD :: Prism' Dec (TypeFamilyHead, [TySynEqn])
- _RoleAnnotD :: Prism' Dec (Name, [Role])
- _StandaloneDerivD :: Prism' Dec (Maybe DerivStrategy, Cxt, Type)
- _DefaultSigD :: Prism' Dec (Name, Type)
- _DataFamilyD :: Prism' Dec (Name, [TyVarBndrVis], Maybe Kind)
- _OpenTypeFamilyD :: Prism' Dec TypeFamilyHead
- _PatSynD :: Prism' Dec (Name, PatSynArgs, PatSynDir, Pat)
- _PatSynSigD :: Prism' Dec (Name, PatSynType)
- _ImplicitParamBindD :: Prism' Dec (String, Exp)
- _DefaultD :: Prism' Dec [Type]
- _TypeDataD :: Prism' Dec (Name, [TyVarBndrVis], Maybe Kind, [Con])
- _Unidir :: Prism' PatSynDir ()
- _ImplBidir :: Prism' PatSynDir ()
- _ExplBidir :: Prism' PatSynDir [Clause]
- _PrefixPatSyn :: Prism' PatSynArgs [Name]
- _InfixPatSyn :: Prism' PatSynArgs (Name, Name)
- _RecordPatSyn :: Prism' PatSynArgs [Name]
- _NormalC :: Prism' Con (Name, [BangType])
- _RecC :: Prism' Con (Name, [VarBangType])
- _InfixC :: Prism' Con (BangType, Name, BangType)
- _ForallC :: Prism' Con ([TyVarBndrSpec], Cxt, Con)
- _GadtC :: Prism' Con ([Name], [BangType], Type)
- _RecGadtC :: Prism' Con ([Name], [VarBangType], Type)
- _Overlappable :: Prism' Overlap ()
- _Overlapping :: Prism' Overlap ()
- _Overlaps :: Prism' Overlap ()
- _Incoherent :: Prism' Overlap ()
- _NoSourceUnpackedness :: Prism' SourceUnpackedness ()
- _SourceNoUnpack :: Prism' SourceUnpackedness ()
- _SourceUnpack :: Prism' SourceUnpackedness ()
- _NoSourceStrictness :: Prism' SourceStrictness ()
- _SourceLazy :: Prism' SourceStrictness ()
- _SourceStrict :: Prism' SourceStrictness ()
- _DecidedLazy :: Prism' DecidedStrictness ()
- _DecidedStrict :: Prism' DecidedStrictness ()
- _DecidedUnpack :: Prism' DecidedStrictness ()
- _ImportF :: Prism' Foreign (Callconv, Safety, String, Name, Type)
- _ExportF :: Prism' Foreign (Callconv, String, Name, Type)
- _CCall :: Prism' Callconv ()
- _StdCall :: Prism' Callconv ()
- _CApi :: Prism' Callconv ()
- _Prim :: Prism' Callconv ()
- _JavaScript :: Prism' Callconv ()
- _Unsafe :: Prism' Safety ()
- _Safe :: Prism' Safety ()
- _Interruptible :: Prism' Safety ()
- _InlineP :: Prism' Pragma (Name, Inline, RuleMatch, Phases)
- _SpecialiseP :: Prism' Pragma (Name, Type, Maybe Inline, Phases)
- _SpecialiseInstP :: Prism' Pragma Type
- _RuleP :: Prism' Pragma (String, Maybe [TyVarBndrUnit], [RuleBndr], Exp, Exp, Phases)
- _AnnP :: Prism' Pragma (AnnTarget, Exp)
- _LineP :: Prism' Pragma (Int, String)
- _CompleteP :: Prism' Pragma ([Name], Maybe Name)
- _OpaqueP :: Prism' Pragma Name
- _NoInline :: Prism' Inline ()
- _Inline :: Prism' Inline ()
- _Inlinable :: Prism' Inline ()
- _ConLike :: Prism' RuleMatch ()
- _FunLike :: Prism' RuleMatch ()
- _AllPhases :: Prism' Phases ()
- _FromPhase :: Prism' Phases Int
- _BeforePhase :: Prism' Phases Int
- _RuleVar :: Prism' RuleBndr Name
- _TypedRuleVar :: Prism' RuleBndr (Name, Type)
- _ModuleAnnotation :: Prism' AnnTarget ()
- _TypeAnnotation :: Prism' AnnTarget Name
- _ValueAnnotation :: Prism' AnnTarget Name
- _FunDep :: Iso' FunDep ([Name], [Name])
- _InfixL :: Prism' FixityDirection ()
- _InfixR :: Prism' FixityDirection ()
- _InfixN :: Prism' FixityDirection ()
- _VarE :: Prism' Exp Name
- _ConE :: Prism' Exp Name
- _LitE :: Prism' Exp Lit
- _AppE :: Prism' Exp (Exp, Exp)
- _AppTypeE :: Prism' Exp (Exp, Type)
- _InfixE :: Prism' Exp (Maybe Exp, Exp, Maybe Exp)
- _UInfixE :: Prism' Exp (Exp, Exp, Exp)
- _ParensE :: Prism' Exp Exp
- _LamE :: Prism' Exp ([Pat], Exp)
- _LamCaseE :: Prism' Exp [Match]
- _TupE :: Prism' Exp [Maybe Exp]
- _UnboxedTupE :: Prism' Exp [Maybe Exp]
- _UnboxedSumE :: Prism' Exp (Exp, SumAlt, SumArity)
- _CondE :: Prism' Exp (Exp, Exp, Exp)
- _MultiIfE :: Prism' Exp [(Guard, Exp)]
- _LetE :: Prism' Exp ([Dec], Exp)
- _CaseE :: Prism' Exp (Exp, [Match])
- _DoE :: Prism' Exp (Maybe ModName, [Stmt])
- _CompE :: Prism' Exp [Stmt]
- _ArithSeqE :: Prism' Exp Range
- _ListE :: Prism' Exp [Exp]
- _SigE :: Prism' Exp (Exp, Type)
- _RecConE :: Prism' Exp (Name, [FieldExp])
- _RecUpdE :: Prism' Exp (Exp, [FieldExp])
- _StaticE :: Prism' Exp Exp
- _UnboundVarE :: Prism' Exp Name
- _LabelE :: Prism' Exp String
- _MDoE :: Prism' Exp (Maybe ModName, [Stmt])
- _ImplicitParamVarE :: Prism' Exp String
- _GetFieldE :: Prism' Exp (Exp, String)
- _ProjectionE :: Prism' Exp (NonEmpty String)
- _LamCasesE :: Prism' Exp [Clause]
- _TypedBracketE :: Prism' Exp Exp
- _TypedSpliceE :: Prism' Exp Exp
- _GuardedB :: Prism' Body [(Guard, Exp)]
- _NormalB :: Prism' Body Exp
- _NormalG :: Prism' Guard Exp
- _PatG :: Prism' Guard [Stmt]
- _BindS :: Prism' Stmt (Pat, Exp)
- _LetS :: Prism' Stmt [Dec]
- _NoBindS :: Prism' Stmt Exp
- _ParS :: Prism' Stmt [[Stmt]]
- _RecS :: Prism' Stmt [Stmt]
- _FromR :: Prism' Range Exp
- _FromThenR :: Prism' Range (Exp, Exp)
- _FromToR :: Prism' Range (Exp, Exp)
- _FromThenToR :: Prism' Range (Exp, Exp, Exp)
- _CharL :: Prism' Lit Char
- _StringL :: Prism' Lit String
- _IntegerL :: Prism' Lit Integer
- _RationalL :: Prism' Lit Rational
- _IntPrimL :: Prism' Lit Integer
- _WordPrimL :: Prism' Lit Integer
- _FloatPrimL :: Prism' Lit Rational
- _DoublePrimL :: Prism' Lit Rational
- _StringPrimL :: Prism' Lit [Word8]
- _CharPrimL :: Prism' Lit Char
- _BytesPrimL :: Prism' Lit Bytes
- _LitP :: Prism' Pat Lit
- _VarP :: Prism' Pat Name
- _TupP :: Prism' Pat [Pat]
- _UnboxedTupP :: Prism' Pat [Pat]
- _UnboxedSumP :: Prism' Pat (Pat, SumAlt, SumArity)
- _ConP :: Prism' Pat (Name, [Type], [Pat])
- _InfixP :: Prism' Pat (Pat, Name, Pat)
- _UInfixP :: Prism' Pat (Pat, Name, Pat)
- _ParensP :: Prism' Pat Pat
- _TildeP :: Prism' Pat Pat
- _BangP :: Prism' Pat Pat
- _AsP :: Prism' Pat (Name, Pat)
- _WildP :: Prism' Pat ()
- _RecP :: Prism' Pat (Name, [FieldPat])
- _ListP :: Prism' Pat [Pat]
- _SigP :: Prism' Pat (Pat, Type)
- _ViewP :: Prism' Pat (Exp, Pat)
- _ForallT :: Prism' Type ([TyVarBndrSpec], Cxt, Type)
- _AppT :: Prism' Type (Type, Type)
- _SigT :: Prism' Type (Type, Kind)
- _VarT :: Prism' Type Name
- _ConT :: Prism' Type Name
- _PromotedT :: Prism' Type Name
- _TupleT :: Prism' Type Int
- _UnboxedTupleT :: Prism' Type Int
- _UnboxedSumT :: Prism' Type SumArity
- _ArrowT :: Prism' Type ()
- _EqualityT :: Prism' Type ()
- _ListT :: Prism' Type ()
- _PromotedTupleT :: Prism' Type Int
- _PromotedNilT :: Prism' Type ()
- _PromotedConsT :: Prism' Type ()
- _StarT :: Prism' Type ()
- _ConstraintT :: Prism' Type ()
- _LitT :: Prism' Type TyLit
- _InfixT :: Prism' Type (Type, Name, Type)
- _UInfixT :: Prism' Type (Type, Name, Type)
- _ParensT :: Prism' Type Type
- _WildCardT :: Prism' Type ()
- _AppKindT :: Prism' Type (Type, Kind)
- _ImplicitParamT :: Prism' Type (String, Type)
- _ForallVisT :: Prism' Type ([TyVarBndrUnit], Type)
- _MulArrowT :: Prism' Type ()
- _PromotedInfixT :: Prism' Type (Type, Name, Type)
- _PromotedUInfixT :: Prism' Type (Type, Name, Type)
- _SpecifiedSpec :: Prism' Specificity ()
- _InferredSpec :: Prism' Specificity ()
- _BndrReq :: Prism' BndrVis ()
- _BndrInvis :: Prism' BndrVis ()
- _PlainTV :: forall flag p f. (Choice p, Applicative f) => p (Name, flag) (f (Name, flag)) -> p (TyVarBndr flag) (f (TyVarBndr flag))
- _KindedTV :: forall flag p f. (Choice p, Applicative f) => p (Name, flag, Kind) (f (Name, flag, Kind)) -> p (TyVarBndr flag) (f (TyVarBndr flag))
- _NoSig :: Prism' FamilyResultSig ()
- _KindSig :: Prism' FamilyResultSig Kind
- _TyVarSig :: Prism' FamilyResultSig TyVarBndrUnit
- _NumTyLit :: Prism' TyLit Integer
- _StrTyLit :: Prism' TyLit String
- _CharTyLit :: Prism' TyLit Char
- _NominalR :: Prism' Role ()
- _RepresentationalR :: Prism' Role ()
- _PhantomR :: Prism' Role ()
- _InferR :: Prism' Role ()
- _StockStrategy :: Prism' DerivStrategy ()
- _AnyclassStrategy :: Prism' DerivStrategy ()
- _NewtypeStrategy :: Prism' DerivStrategy ()

# Traversals

class HasName t where #

Has a `Name`

Methods

name :: Lens' t Name #

Extract (or modify) the `Name` of something

#### Instances

Instances details

HasName Con # | On `template-haskell-2.11.0.0` or later, if a `GadtC` or `RecGadtC` has multiple `Name`s, the leftmost `Name` will be chosen.
Instance details Defined in Language.Haskell.TH.Lens Methods name :: Lens' Con Name #
HasName Foreign # |
Instance details Defined in Language.Haskell.TH.Lens Methods name :: Lens' Foreign Name #
HasName InjectivityAnn # |
Instance details Defined in Language.Haskell.TH.Lens Methods name :: Lens' InjectivityAnn Name #
HasName Name # |
Instance details Defined in Language.Haskell.TH.Lens Methods name :: Lens' Name Name #
HasName RuleBndr # |
Instance details Defined in Language.Haskell.TH.Lens Methods name :: Lens' RuleBndr Name #
HasName TypeFamilyHead # |
Instance details Defined in Language.Haskell.TH.Lens Methods name :: Lens' TypeFamilyHead Name #
HasName (TyVarBndr_ flag) # |
Instance details Defined in Language.Haskell.TH.Lens Methods name :: Lens' (TyVarBndr_ flag) Name #

class HasTypes t where #

Contains some amount of `Type`s inside

Methods

types :: Traversal' t Type #

Traverse all the types

#### Instances

Instances details

HasTypes Con # |
Instance details Defined in Language.Haskell.TH.Lens Methods types :: Traversal' Con Type #
HasTypes Foreign # |
Instance details Defined in Language.Haskell.TH.Lens Methods types :: Traversal' Foreign Type #
HasTypes TySynEqn # |
Instance details Defined in Language.Haskell.TH.Lens Methods types :: Traversal' TySynEqn Type #
HasTypes Type # |
Instance details Defined in Language.Haskell.TH.Lens Methods types :: Traversal' Type Type #
HasTypes t => HasTypes [t] # |
Instance details Defined in Language.Haskell.TH.Lens Methods types :: Traversal' [t] Type #

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

#### Instances

Instances details

HasTypeVars Con # |
Instance details Defined in Language.Haskell.TH.Lens Methods typeVarsEx :: Set Name -> Traversal' Con Name #
HasTypeVars Name # |
Instance details Defined in Language.Haskell.TH.Lens Methods typeVarsEx :: Set Name -> Traversal' Name Name #
HasTypeVars Type # |
Instance details Defined in Language.Haskell.TH.Lens Methods typeVarsEx :: Set Name -> Traversal' Type Name #
HasTypeVars (TyVarBndr_ flag) # |
Instance details Defined in Language.Haskell.TH.Lens Methods typeVarsEx :: Set Name -> Traversal' (TyVarBndr_ flag) Name #
HasTypeVars t => HasTypeVars (Maybe t) # |
Instance details Defined in Language.Haskell.TH.Lens Methods typeVarsEx :: Set Name -> Traversal' (Maybe t) Name #
HasTypeVars t => HasTypeVars [t] # |
Instance details Defined in Language.Haskell.TH.Lens Methods typeVarsEx :: Set Name -> Traversal' [t] Name #

class SubstType t where #

Provides substitution for types

Methods

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

Perform substitution for types

#### Instances

Instances details

SubstType Type # |
Instance details Defined in Language.Haskell.TH.Lens Methods substType :: Map Name Type -> Type -> Type #
SubstType t => SubstType [t] # |
Instance details Defined in Language.Haskell.TH.Lens Methods substType :: Map Name Type -> [t] -> [t] #

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 BangType #

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

conNamedFields :: Traversal' Con VarBangType #

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

# Lenses

## Loc Lenses

locFileName :: Lens' Loc String #

locPackage :: Lens' Loc String #

locModule :: Lens' Loc String #

locStart :: Lens' Loc CharPos #

locEnd :: Lens' Loc CharPos #

## FunDep Lenses

funDepInputs :: Lens' FunDep [Name] #

funDepOutputs :: Lens' FunDep [Name] #

## Match Lenses

matchPattern :: Lens' Match Pat #

matchBody :: Lens' Match Body #

matchDeclarations :: Lens' Match [Dec] #

## Fixity Lenses

fixityPrecedence :: Lens' Fixity Int #

fixityDirection :: Lens' Fixity FixityDirection #

## Clause Lenses

clausePattern :: Lens' Clause [Pat] #

clauseBody :: Lens' Clause Body #

clauseDecs :: Lens' Clause [Dec] #

## FieldExp Lenses

fieldExpName :: Lens' FieldExp Name #

fieldExpExpression :: Lens' FieldExp Exp #

## FieldPat Lenses

fieldPatName :: Lens' FieldPat Name #

fieldPatPattern :: Lens' FieldPat Pat #

## TySynEqn Lenses

tySynEqnLHS :: Lens' TySynEqn Type #

tySynEqnPatterns :: Lens' TySynEqn [Type] #

tySynEqnResult :: Lens' TySynEqn Type #

## InjectivityAnn Lenses

injectivityAnnOutput :: Lens' InjectivityAnn Name #

injectivityAnnInputs :: Lens' InjectivityAnn [Name] #

## TypeFamilyHead Lenses

typeFamilyHeadName :: Lens' TypeFamilyHead Name #

typeFamilyHeadTyVarBndrs :: Lens' TypeFamilyHead [TyVarBndrVis] #

typeFamilyHeadResultSig :: Lens' TypeFamilyHead FamilyResultSig #

typeFamilyHeadInjectivityAnn :: Lens' TypeFamilyHead (Maybe InjectivityAnn) #

## Bang Lenses

bangSourceUnpackedness :: Lens' Bang SourceUnpackedness #

bangSourceStrictness :: Lens' Bang SourceStrictness #

## DerivClause Lenses

derivClauseStrategy :: Lens' DerivClause (Maybe DerivStrategy) #

derivClauseCxt :: Lens' DerivClause Cxt #

# Prisms

## Info Prisms

_ClassI :: Prism' Info (Dec, [InstanceDec]) #

_ClassOpI :: Prism' Info (Name, Type, ParentName) #

_TyConI :: Prism' Info Dec #

_FamilyI :: Prism' Info (Dec, [InstanceDec]) #

_PrimTyConI :: Prism' Info (Name, Arity, Unlifted) #

_DataConI :: Prism' Info (Name, Type, ParentName) #

_VarI :: Prism' Info (Name, Type, Maybe Dec) #

_TyVarI :: Prism' Info (Name, Type) #

_PatSynI :: Prism' Info (Name, PatSynType) #

## Dec Prisms

_FunD :: Prism' Dec (Name, [Clause]) #

_ValD :: Prism' Dec (Pat, Body, [Dec]) #

_DataD :: DataPrism' [TyVarBndrVis] [Con] #

    _DataD :: Prism' Dec (Cxt, Name, [TyVarBndrUnit], Maybe Kind, [Con], [DerivClause]) -- template-haskell-2.12+
    _DataD :: Prism' Dec (Cxt, Name, [Type],          Maybe Kind, [Con], Cxt)           -- Earlier versions

_NewtypeD :: DataPrism' [TyVarBndrVis] Con #

    _NewtypeD :: Prism' Dec (Cxt, Name, [TyVarBndrUnit], Maybe Kind, Con, [DerivClause]) -- template-haskell-2.12+
    _NewtypeD :: Prism' Dec (Cxt, Name, [Type],          Maybe Kind, Con, Cxt)           -- Earlier versions

_TySynD :: Prism' Dec (Name, [TyVarBndrVis], Type) #

_ClassD :: Prism' Dec (Cxt, Name, [TyVarBndrVis], [FunDep], [Dec]) #

_InstanceD :: Prism' Dec (Maybe Overlap, Cxt, Type, [Dec]) #

_SigD :: Prism' Dec (Name, Type) #

_ForeignD :: Prism' Dec Foreign #

_InfixD :: Prism' Dec (Fixity, Name) #

_PragmaD :: Prism' Dec Pragma #

_DataInstD :: Prism' Dec (Cxt, Maybe [TyVarBndrUnit], Type, Maybe Kind, [Con], [DerivClause]) #

    _DataInstD :: Prism' Dec (Cxt, Maybe [TyVarBndrUnit], Type, Maybe Kind, [Con], [DerivClause]) -- template-haskell-2.15+
    _DataInstD :: Prism' Dec (Cxt, Name, [Type],                Maybe Kind, [Con], [DerivClause]) -- template-haskell-2.12 through 2.14
    _DataInstD :: Prism' Dec (Cxt, Name, [Type],                Maybe Kind, [Con], Cxt)           -- Earlier versions

_NewtypeInstD :: Prism' Dec (Cxt, Maybe [TyVarBndrUnit], Type, Maybe Kind, Con, [DerivClause]) #

    _NewtypeInstD :: Prism' Dec (Cxt, Maybe [TyVarBndrUnit], Type, Maybe Kind, Con, [DerivClause]) -- template-haskell-2.15+
    _NewtypeInstD :: Prism' Dec (Cxt, Name, [Type],                Maybe Kind, Con, [DerivClause]) -- template-haskell-2.12 through 2.14
    _NewtypeInstD :: Prism' Dec (Cxt, Name, [Type],                Maybe Kind, Con, Cxt)           -- Earlier versions

_TySynInstD :: Prism' Dec TySynEqn #

    _TySynInstD :: Prism' Dec TySynEqn             -- template-haskell-2.15+
    _TySynInstD :: Prism' Dec (Name, TySynEqn)     -- template-haskell-2.9 through 2.14
    _TySynInstD :: Prism' Dec (Name, [Type], Type) -- Earlier versions

_ClosedTypeFamilyD :: Prism' Dec (TypeFamilyHead, [TySynEqn]) #

_RoleAnnotD :: Prism' Dec (Name, [Role]) #

_StandaloneDerivD :: Prism' Dec (Maybe DerivStrategy, Cxt, Type) #

    _StandaloneDerivD :: Prism' Dec (Maybe DerivStrategy, Cxt, Type) -- template-haskell-2.12+
    _StandaloneDerivD :: Prism' Dec                      (Cxt, Type) -- Earlier versions

_DefaultSigD :: Prism' Dec (Name, Type) #

_DataFamilyD :: Prism' Dec (Name, [TyVarBndrVis], Maybe Kind) #

_OpenTypeFamilyD :: Prism' Dec TypeFamilyHead #

_PatSynD :: Prism' Dec (Name, PatSynArgs, PatSynDir, Pat) #

_PatSynSigD :: Prism' Dec (Name, PatSynType) #

_ImplicitParamBindD :: Prism' Dec (String, Exp) #

_DefaultD :: Prism' Dec [Type] #

_TypeDataD :: Prism' Dec (Name, [TyVarBndrVis], Maybe Kind, [Con]) #

## PatSynDir Prisms

_Unidir :: Prism' PatSynDir () #

_ImplBidir :: Prism' PatSynDir () #

_ExplBidir :: Prism' PatSynDir [Clause] #

## PatSynArgs Prisms

_PrefixPatSyn :: Prism' PatSynArgs [Name] #

_InfixPatSyn :: Prism' PatSynArgs (Name, Name) #

_RecordPatSyn :: Prism' PatSynArgs [Name] #

## Con Prisms

_NormalC :: Prism' Con (Name, [BangType]) #

_RecC :: Prism' Con (Name, [VarBangType]) #

_InfixC :: Prism' Con (BangType, Name, BangType) #

_ForallC :: Prism' Con ([TyVarBndrSpec], Cxt, Con) #

_GadtC :: Prism' Con ([Name], [BangType], Type) #

_RecGadtC :: Prism' Con ([Name], [VarBangType], Type) #

## Overlap Prisms

_Overlappable :: Prism' Overlap () #

_Overlapping :: Prism' Overlap () #

_Overlaps :: Prism' Overlap () #

_Incoherent :: Prism' Overlap () #

## SourceUnpackedness Prisms

_NoSourceUnpackedness :: Prism' SourceUnpackedness () #

_SourceNoUnpack :: Prism' SourceUnpackedness () #

_SourceUnpack :: Prism' SourceUnpackedness () #

## SourceStrictness Prisms

_NoSourceStrictness :: Prism' SourceStrictness () #

_SourceLazy :: Prism' SourceStrictness () #

_SourceStrict :: Prism' SourceStrictness () #

## DecidedStrictness Prisms

_DecidedLazy :: Prism' DecidedStrictness () #

_DecidedStrict :: Prism' DecidedStrictness () #

_DecidedUnpack :: Prism' DecidedStrictness () #

## Foreign Prisms

_ImportF :: Prism' Foreign (Callconv, Safety, String, Name, Type) #

_ExportF :: Prism' Foreign (Callconv, String, Name, Type) #

## Callconv Prisms

_CCall :: Prism' Callconv () #

_StdCall :: Prism' Callconv () #

_CApi :: Prism' Callconv () #

_Prim :: Prism' Callconv () #

_JavaScript :: Prism' Callconv () #

## Safety Prisms

_Unsafe :: Prism' Safety () #

_Safe :: Prism' Safety () #

_Interruptible :: Prism' Safety () #

## Pragma Prisms

_InlineP :: Prism' Pragma (Name, Inline, RuleMatch, Phases) #

_SpecialiseP :: Prism' Pragma (Name, Type, Maybe Inline, Phases) #

_SpecialiseInstP :: Prism' Pragma Type #

_RuleP :: Prism' Pragma (String, Maybe [TyVarBndrUnit], [RuleBndr], Exp, Exp, Phases) #

    _RuleP :: Prism' Pragma (String, Maybe [TyVarBndrUnit], [RuleBndr], Exp, Exp, Phases) -- template-haskell-2.15+
    _RuleP :: Prism' Pragma (String,                        [RuleBndr], Exp, Exp, Phases) -- Earlier versions

_AnnP :: Prism' Pragma (AnnTarget, Exp) #

_LineP :: Prism' Pragma (Int, String) #

_CompleteP :: Prism' Pragma ([Name], Maybe Name) #

_OpaqueP :: Prism' Pragma Name #

## Inline Prisms

_NoInline :: Prism' Inline () #

_Inline :: Prism' Inline () #

_Inlinable :: Prism' Inline () #

## RuleMatch Prisms

_ConLike :: Prism' RuleMatch () #

_FunLike :: Prism' RuleMatch () #

## Phases Prisms

_AllPhases :: Prism' Phases () #

_FromPhase :: Prism' Phases Int #

_BeforePhase :: Prism' Phases Int #

## RuleBndr Prisms

_RuleVar :: Prism' RuleBndr Name #

_TypedRuleVar :: Prism' RuleBndr (Name, Type) #

## AnnTarget Prisms

_ModuleAnnotation :: Prism' AnnTarget () #

_TypeAnnotation :: Prism' AnnTarget Name #

_ValueAnnotation :: Prism' AnnTarget Name #

## FunDep Prisms TODO make a lens

_FunDep :: Iso' FunDep ([Name], [Name]) #

## FixityDirection Prisms

_InfixL :: Prism' FixityDirection () #

_InfixR :: Prism' FixityDirection () #

_InfixN :: Prism' FixityDirection () #

## Exp Prisms

_VarE :: Prism' Exp Name #

_ConE :: Prism' Exp Name #

_LitE :: Prism' Exp Lit #

_AppE :: Prism' Exp (Exp, Exp) #

_AppTypeE :: Prism' Exp (Exp, Type) #

_InfixE :: Prism' Exp (Maybe Exp, Exp, Maybe Exp) #

_UInfixE :: Prism' Exp (Exp, Exp, Exp) #

_ParensE :: Prism' Exp Exp #

_LamE :: Prism' Exp ([Pat], Exp) #

_LamCaseE :: Prism' Exp [Match] #

_TupE :: Prism' Exp [Maybe Exp] #

    _TupE :: Prism' Exp [Maybe Exp] -- template-haskell-2.16+
    _TupE :: Prism' Exp [Exp]       -- Earlier versions

_UnboxedTupE :: Prism' Exp [Maybe Exp] #

    _UnboxedTupE :: Prism' Exp [Maybe Exp] -- template-haskell-2.16+
    _UnboxedTupE :: Prism' Exp [Exp]       -- Earlier versions

_UnboxedSumE :: Prism' Exp (Exp, SumAlt, SumArity) #

_CondE :: Prism' Exp (Exp, Exp, Exp) #

_MultiIfE :: Prism' Exp [(Guard, Exp)] #

_LetE :: Prism' Exp ([Dec], Exp) #

_CaseE :: Prism' Exp (Exp, [Match]) #

_DoE :: Prism' Exp (Maybe ModName, [Stmt]) #

    _DoE :: Prism' Exp (Maybe ModName, [Stmt]) -- template-haskell-2.17+
    _DoE :: Prism' Exp [Stmt]                  -- Earlier versions

_CompE :: Prism' Exp [Stmt] #

_ArithSeqE :: Prism' Exp Range #

_ListE :: Prism' Exp [Exp] #

_SigE :: Prism' Exp (Exp, Type) #

_RecConE :: Prism' Exp (Name, [FieldExp]) #

_RecUpdE :: Prism' Exp (Exp, [FieldExp]) #

_StaticE :: Prism' Exp Exp #

_UnboundVarE :: Prism' Exp Name #

_LabelE :: Prism' Exp String #

_MDoE :: Prism' Exp (Maybe ModName, [Stmt]) #

    _MDoE :: Prism' Exp (Maybe ModName, [Stmt]) -- template-haskell-2.17+
    _MDoE :: Prism' Exp [Stmt]                  -- Earlier versions

_ImplicitParamVarE :: Prism' Exp String #

_GetFieldE :: Prism' Exp (Exp, String) #

_ProjectionE :: Prism' Exp (NonEmpty String) #

_LamCasesE :: Prism' Exp [Clause] #

_TypedBracketE :: Prism' Exp Exp #

_TypedSpliceE :: Prism' Exp Exp #

## Body Prisms

_GuardedB :: Prism' Body [(Guard, Exp)] #

_NormalB :: Prism' Body Exp #

## Guard Prisms

_NormalG :: Prism' Guard Exp #

_PatG :: Prism' Guard [Stmt] #

## Stmt Prisms

_BindS :: Prism' Stmt (Pat, Exp) #

_LetS :: Prism' Stmt [Dec] #

_NoBindS :: Prism' Stmt Exp #

_ParS :: Prism' Stmt [[Stmt]] #

_RecS :: Prism' Stmt [Stmt] #

## Range Prisms

_FromR :: Prism' Range Exp #

_FromThenR :: Prism' Range (Exp, Exp) #

_FromToR :: Prism' Range (Exp, Exp) #

_FromThenToR :: Prism' Range (Exp, Exp, Exp) #

## Lit Prisms

_CharL :: Prism' Lit Char #

_StringL :: Prism' Lit String #

_IntegerL :: Prism' Lit Integer #

_RationalL :: Prism' Lit Rational #

_IntPrimL :: Prism' Lit Integer #

_WordPrimL :: Prism' Lit Integer #

_FloatPrimL :: Prism' Lit Rational #

_DoublePrimL :: Prism' Lit Rational #

_StringPrimL :: Prism' Lit [Word8] #

_CharPrimL :: Prism' Lit Char #

_BytesPrimL :: Prism' Lit Bytes #

## Pat Prisms

_LitP :: Prism' Pat Lit #

_VarP :: Prism' Pat Name #

_TupP :: Prism' Pat [Pat] #

_UnboxedTupP :: Prism' Pat [Pat] #

_UnboxedSumP :: Prism' Pat (Pat, SumAlt, SumArity) #

_ConP :: Prism' Pat (Name, [Type], [Pat]) #

    _ConP :: Prism' Pat (Name, [Type], [Pat]) -- template-haskell-2.18+
    _ConP :: Prism' Pat (Name,         [Pat]) -- Earlier versions

_InfixP :: Prism' Pat (Pat, Name, Pat) #

_UInfixP :: Prism' Pat (Pat, Name, Pat) #

_ParensP :: Prism' Pat Pat #

_TildeP :: Prism' Pat Pat #

_BangP :: Prism' Pat Pat #

_AsP :: Prism' Pat (Name, Pat) #

_WildP :: Prism' Pat () #

_RecP :: Prism' Pat (Name, [FieldPat]) #

_ListP :: Prism' Pat [Pat] #

_SigP :: Prism' Pat (Pat, Type) #

_ViewP :: Prism' Pat (Exp, Pat) #

## Type Prisms

_ForallT :: Prism' Type ([TyVarBndrSpec], Cxt, Type) #

_AppT :: Prism' Type (Type, Type) #

_SigT :: Prism' Type (Type, Kind) #

_VarT :: Prism' Type Name #

_ConT :: Prism' Type Name #

_PromotedT :: Prism' Type Name #

_TupleT :: Prism' Type Int #

_UnboxedTupleT :: Prism' Type Int #

_UnboxedSumT :: Prism' Type SumArity #

_ArrowT :: Prism' Type () #

_EqualityT :: Prism' Type () #

_ListT :: Prism' Type () #

_PromotedTupleT :: Prism' Type Int #

_PromotedNilT :: Prism' Type () #

_PromotedConsT :: Prism' Type () #

_StarT :: Prism' Type () #

_ConstraintT :: Prism' Type () #

_LitT :: Prism' Type TyLit #

_InfixT :: Prism' Type (Type, Name, Type) #

_UInfixT :: Prism' Type (Type, Name, Type) #

_ParensT :: Prism' Type Type #

_WildCardT :: Prism' Type () #

_AppKindT :: Prism' Type (Type, Kind) #

_ImplicitParamT :: Prism' Type (String, Type) #

_ForallVisT :: Prism' Type ([TyVarBndrUnit], Type) #

_MulArrowT :: Prism' Type () #

_PromotedInfixT :: Prism' Type (Type, Name, Type) #

_PromotedUInfixT :: Prism' Type (Type, Name, Type) #

## Specificity Prisms

_SpecifiedSpec :: Prism' Specificity () #

_InferredSpec :: Prism' Specificity () #

## BndrVis Prisms

_BndrReq :: Prism' BndrVis () #

_BndrInvis :: Prism' BndrVis () #

## TyVarBndr Prisms

_PlainTV :: forall flag p f. (Choice p, Applicative f) => p (Name, flag) (f (Name, flag)) -> p (TyVarBndr flag) (f (TyVarBndr flag)) #

    _PlainTV :: Prism' (TyVarBndr flag) (Name, flag) -- template-haskell-2.17+
    _PlainTV :: Prism'  TyVarBndr        Name        -- Earlier versions

_KindedTV :: forall flag p f. (Choice p, Applicative f) => p (Name, flag, Kind) (f (Name, flag, Kind)) -> p (TyVarBndr flag) (f (TyVarBndr flag)) #

    _KindedTV :: Prism' (TyVarBndr flag) (Name, flag, Kind) -- template-haskell-2.17+
    _KindedTV :: Prism'  TyVarBndr       (Name,       Kind) -- Earlier versions

## FamilyResultSig Prisms

_NoSig :: Prism' FamilyResultSig () #

_KindSig :: Prism' FamilyResultSig Kind #

_TyVarSig :: Prism' FamilyResultSig TyVarBndrUnit #

## TyLit Prisms

_NumTyLit :: Prism' TyLit Integer #

_StrTyLit :: Prism' TyLit String #

_CharTyLit :: Prism' TyLit Char #

## Role Prisms

_NominalR :: Prism' Role () #

_RepresentationalR :: Prism' Role () #

_PhantomR :: Prism' Role () #

_InferR :: Prism' Role () #

## DerivStrategy Prisms

_StockStrategy :: Prism' DerivStrategy () #

_AnyclassStrategy :: Prism' DerivStrategy () #

_NewtypeStrategy :: Prism' DerivStrategy () #