names-th-0.2.0.3: Manipulate name strings for TH

Copyright2013 Kei Hibino
LicenseBSD3
Maintainerex8k.hibino@gmail.com
Stabilityexperimental
Portabilityunknown
Safe HaskellNone
LanguageHaskell2010

Language.Haskell.TH.Name.CamelCase

Contents

Description

This module provides camelcased Name for Template Haskell

Synopsis

Types to wrap Name

Wrap Name to distinguish constructor names and variable names.

newtype ConName #

Type to wrap constructor's Name.

Constructors

ConName 

Fields

toConName :: String -> ConName #

Make constructor name from String.

newtype VarName #

Type to wrap variable's Name.

Constructors

VarName 

Fields

toVarName :: String -> VarName #

Make variable name from String.

Functions to make camel-cased names

Make camel-cased names.

conCamelcaseName :: String -> ConName #

Make camel-cased constructor name from String.

varCamelcaseName :: String -> VarName #

Make camel-cased variable name from String.

varNameWithPrefix :: String -> String -> VarName #

Make camel-cased variable name with prefix like below.

 name `varNamePrefix` prefix

Functions to generate haskell template from names

Make haskell templates from names.

toTypeCon :: ConName -> TypeQ #

Make type constructor TypeQ monad from constructor name type.

toDataCon :: ConName -> ExpQ #

Make data constructor ExpQ monad from constructor name type.

toVarExp :: VarName -> ExpQ #

Make variable ExpQ monad from variable name type.

toVarPat :: VarName -> PatQ #

Make pattern PatQ monad from variable name type.