lens-5.2.3: Lenses, Folds and Traversals

Copyright | (C) 2013-2016 Edward Kmett and Eric Mertens
License | BSD-style (see the file LICENSE)
Maintainer | Edward Kmett <ekmett@gmail.com>
Stability | experimental
Portability | non-portable
Safe Haskell | Safe
Language | Haskell2010

Control.Lens.Internal.TH

Description

Synopsis

- type TyVarBndrVis = TyVarBndr_ ()
- unSigT :: Type -> Type
- composeValName :: Name
- idValName :: Name
- fmapValName :: Name
- pureValName :: Name
- apValName :: Name
- quantifyType :: Cxt -> Type -> Type
- appsT :: TypeQ -> [TypeQ] -> TypeQ
- appsE1 :: ExpQ -> [ExpQ] -> ExpQ
- toTupleT :: [TypeQ] -> TypeQ
- toTupleE :: [ExpQ] -> ExpQ
- toTupleP :: [PatQ] -> PatQ
- conAppsT :: Name -> [Type] -> Type
- newNames :: String -> Int -> Q [Name]
- unfoldType :: Type -> (Type, [Type])
- datatypeTypeKinded :: DatatypeInfo -> Type
- dropSigsIfNonDataFam :: DatatypeInfo -> [Type] -> [Type]
- isDataFamily :: DatatypeVariant -> Bool
- quantifyType' :: Set Name -> Cxt -> Type -> Type
- tvbToType :: TyVarBndr_ flag -> Type
- bndrReq :: ()
- traversalTypeName :: Name
- traversal'TypeName :: Name
- lensTypeName :: Name
- lens'TypeName :: Name
- isoTypeName :: Name
- iso'TypeName :: Name
- getterTypeName :: Name
- foldTypeName :: Name
- prismTypeName :: Name
- prism'TypeName :: Name
- reviewTypeName :: Name
- wrappedTypeName :: Name
- unwrappedTypeName :: Name
- rewrappedTypeName :: Name
- _wrapped'ValName :: Name
- isoValName :: Name
- prismValName :: Name
- untoValName :: Name
- phantomValName :: Name
- phantom2 :: (Functor f, Contravariant f) => f a -> f b
- rightDataName :: Name
- leftDataName :: Name
- inlinePragma :: Name -> [DecQ]

# Documentation

type TyVarBndrVis = TyVarBndr_ () Source #

unSigT :: Type -> Type Source #

Peel off a kind signature from a Type (if it has one).

composeValName :: Name Source #

idValName :: Name Source #

fmapValName :: Name Source #

pureValName :: Name Source #

apValName :: Name Source #

quantifyType :: Cxt -> Type -> Type Source #

Template Haskell wants type variables declared in a forall, so we find all free type variables in a given type and declare them.

appsT :: TypeQ -> [TypeQ] -> TypeQ Source #

Apply arguments to a type constructor

appsE1 :: ExpQ -> [ExpQ] -> ExpQ Source #

Apply arguments to a function

toTupleT :: [TypeQ] -> TypeQ Source #

Construct a tuple type given a list of types.

toTupleE :: [ExpQ] -> ExpQ Source #

Construct a tuple value given a list of expressions.

toTupleP :: [PatQ] -> PatQ Source #

Construct a tuple pattern given a list of patterns.

conAppsT :: Name -> [Type] -> Type Source #

Apply arguments to a type constructor.

newNames Source #

Arguments

:: String | base name
-> Int | count
-> Q [Name] |

Generate many new names from a given base name.

unfoldType :: Type -> (Type, [Type]) Source #

Decompose an applied type into its individual components. For example, this:

    Either Int Char

would be unfolded to this:

    (ConT ''Either, [ConT ''Int, ConT ''Char])

This function ignores explicit parentheses and visible kind applications.

datatypeTypeKinded :: DatatypeInfo -> Type Source #

dropSigsIfNonDataFam :: DatatypeInfo -> [Type] -> [Type] Source #

In an effort to prevent users from having to enable KindSignatures every time that they use lens' TH functionality, we strip off reified kind annotations from when:

1. The kind of a type does not contain any kind variables. If it *does* contain kind variables, we want to preserve them so that we can generate type signatures that preserve the dependency order of kind and type variables. (The data types in test/T917.hs contain examples where this is important.) This will require enabling `PolyKinds`, but since `PolyKinds` implies `KindSignatures`, we can at least accomplish two things at once.
2. The data type is not an instance of a data family. We make an exception for data family instances, since the presence or absence of a kind annotation can be the difference between typechecking or not. (See T917DataFam in tests/T917.hs for an example.) Moreover, the `TypeFamilies` extension implies `KindSignatures`.

isDataFamily :: DatatypeVariant -> Bool Source #

quantifyType' :: Set Name -> Cxt -> Type -> Type Source #

This function works like `quantifyType` except that it takes a list of variables to exclude from quantification.

tvbToType :: TyVarBndr_ flag -> Type Source #

Convert a `TyVarBndr` into its corresponding `Type`.

bndrReq :: () Source #

traversalTypeName :: Name Source #

traversal'TypeName :: Name Source #

lensTypeName :: Name Source #

lens'TypeName :: Name Source #

isoTypeName :: Name Source #

iso'TypeName :: Name Source #

getterTypeName :: Name Source #

foldTypeName :: Name Source #

prismTypeName :: Name Source #

prism'TypeName :: Name Source #

reviewTypeName :: Name Source #

wrappedTypeName :: Name Source #

unwrappedTypeName :: Name Source #

rewrappedTypeName :: Name Source #

_wrapped'ValName :: Name Source #

isoValName :: Name Source #

prismValName :: Name Source #

untoValName :: Name Source #

phantomValName :: Name Source #

phantom2 :: (Functor f, Contravariant f) => f a -> f b Source #

rightDataName :: Name Source #

leftDataName :: Name Source #

inlinePragma :: Name -> [DecQ] Source #