names-th-0.1.0.0: 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 Source

Type to wrap constructor's Name.

Constructors

ConName 

Fields

conName :: Name

Get wrapped Name

toConName :: String -> ConName Source

Make constructor name from String.

newtype VarName Source

Type to wrap variable's Name.

Constructors

VarName 

Fields

varName :: Name

Get wrapped Name

toVarName :: String -> VarName Source

Make variable name from String.

Functions to make camel-cased names

Make camel-cased names.

conCamelcaseName :: String -> ConName Source

Make camel-cased constructor name from String.

varCamelcaseName :: String -> VarName Source

Make camel-cased variable name from String.

varNameWithPrefix :: String -> String -> VarName Source

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 Source

Make type constructor TypeQ monad from constructor name type.

toDataCon :: ConName -> ExpQ Source

Make data constructor ExpQ monad from constructor name type.

toVarExp :: VarName -> ExpQ Source

Make variable ExpQ monad from variable name type.

toVarPat :: VarName -> PatQ Source

Make pattern PatQ monad from variable name type.