microlens-th-0.4.3.15: Automatic generation of record lenses for microlens
Copyright(C) 2013-2016 Eric Mertens Edward Kmett; 2018 Monadfix
LicenseBSD-style (see the file LICENSE)
Safe HaskellSafe
LanguageHaskell2010

Lens.Micro.TH.Internal

Description

Functions used by Lens.Micro.TH. This is an internal module and it may go away or change at any time; do not depend on it.

Synopsis

Name utilities

class HasName t where Source #

Has a Name

Methods

name :: Lens' t Name Source #

Extract (or modify) the Name of something

Instances

Instances details
HasName Con Source #

On template-haskell-2.11.0.0 or later, if a GadtC or RecGadtC has multiple Names, the leftmost Name will be chosen.

Instance details

Defined in Lens.Micro.TH.Internal

HasName Name Source # 
Instance details

Defined in Lens.Micro.TH.Internal

HasName (TyVarBndr_ flag) Source # 
Instance details

Defined in Lens.Micro.TH.Internal

Methods

name :: Lens' (TyVarBndr_ flag) Name Source #

newNames Source #

Arguments

:: String

base name

-> Int

count

-> Q [Name] 

Generate many new names from a given base name.

Type variable utilities

class HasTypeVars t where Source #

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

Instances

Instances details
HasTypeVars Con Source # 
Instance details

Defined in Lens.Micro.TH.Internal

HasTypeVars Name Source # 
Instance details

Defined in Lens.Micro.TH.Internal

HasTypeVars Type Source # 
Instance details

Defined in Lens.Micro.TH.Internal

HasTypeVars (TyVarBndr_ flag) Source # 
Instance details

Defined in Lens.Micro.TH.Internal

HasTypeVars t => HasTypeVars (Maybe t) Source # 
Instance details

Defined in Lens.Micro.TH.Internal

HasTypeVars t => HasTypeVars [t] Source # 
Instance details

Defined in Lens.Micro.TH.Internal

Miscellaneous utilities

inlinePragma :: Name -> [DecQ] Source #

Generate an INLINE pragma.

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

Apply arguments to a type constructor.

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.

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.

unSigT :: Type -> Type Source #

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

Lens functions

elemOf :: Eq a => Getting (Endo [a]) s a -> a -> s -> Bool Source #

lengthOf :: Getting (Endo [a]) s a -> s -> Int Source #

setOf :: Ord a => Getting (Endo [a]) s a -> s -> Set a Source #