th-build-0.1.0.0: More convenient construction of TH ASTs

Safe HaskellSafe-Infered

Language.Haskell.TH.Build.Convertible

Contents

Synopsis

Documentation

ifUpperThenElse :: (Name -> t) -> (Name -> t) -> Name -> tSource

class Convertible a b whereSource

Methods

convert :: a -> bSource

Instances

Convertible Integer ExpQ 
Convertible Integer BodyQ 
Convertible Integer Lit 
Convertible String ExpQ 
Convertible String TypeQ

conT or varT, determined by capitalization.

Convertible String StrictTypeQ 
Convertible String Name

conE or varE, determined by capitalization.

Convertible String PatQ

conP or varP, determined by capitalization.

Convertible String TyVarBndr 
Convertible String BodyQ 
Convertible ExpQ BodyQ 
Convertible DecQ DecsQ 
Convertible TypeQ StrictTypeQ

Uses NotStrict.

Convertible Name ExpQ

conE or varE, determined by capitalization.

Convertible Name TypeQ

conT or varT, determined by capitalization.

Convertible Name StrictTypeQ 
Convertible Name PatQ

conP or varP, determined by capitalization.

Convertible Name TyVarBndr 
Convertible Name BodyQ 
Convertible a a 
Convertible RangeQ ExpQ 
Convertible RangeQ BodyQ 
Convertible Lit ExpQ 
Convertible Lit BodyQ 
Convertible String [TypeQ] 
Convertible String [StrictTypeQ] 
Convertible String [PatQ] 
Convertible TypeQ [StrictTypeQ] 
Convertible Name [TypeQ] 
Convertible Name [StrictTypeQ] 
Convertible Name [PatQ] 
Convertible Name [TyVarBndr] 
Convertible () [a]

Empty list

Convertible () (Q [a])

Empty list

Convertible () (Q (Maybe a))

Nothing

Convertible () (Maybe a)

Nothing

Convertible a [a]

Singleton

Convertible [DecQ] DecsQ 
Convertible [PredQ] CxtQ 
Convertible [DecsQ] DecsQ 
Convertible [Integer] [ExpQ] 
Convertible [String] [ExpQ] 
Convertible [String] [TypeQ] 
Convertible [String] [PatQ] 
Convertible [Name] [ExpQ] 
Convertible [Name] [TypeQ] 
Convertible [Name] [PatQ] 
Convertible [RangeQ] [ExpQ] 
Convertible [Lit] [ExpQ] 

(&) :: Convertible a1 a => a1 -> [a] -> [a]Source

Type restrictions of convert

expQs :: Convertible a [ExpQ] => a -> [ExpQ]Source

patQs :: Convertible a [PatQ] => a -> [PatQ]Source

Function transformers

preconvert1 :: Convertible a b => (b -> c) -> a -> cSource

preconvert2 :: (Convertible a1 b, Convertible a b1) => (b1 -> b -> c) -> a -> a1 -> cSource

preconvert3 :: (Convertible a1 b, Convertible a2 b1, Convertible a b2) => (b2 -> b1 -> b -> c) -> a -> a2 -> a1 -> cSource

preconvert4 :: (Convertible a1 b, Convertible a2 b1, Convertible a3 b2, Convertible a b3) => (b3 -> b2 -> b1 -> b -> c) -> a -> a3 -> a2 -> a1 -> cSource

preconvert5 :: (Convertible a1 b, Convertible a2 b1, Convertible a3 b2, Convertible a4 b3, Convertible a b4) => (b4 -> b3 -> b2 -> b1 -> b -> c) -> a -> a4 -> a3 -> a2 -> a1 -> cSource

preconvert6 :: (Convertible a1 b, Convertible a2 b1, Convertible a3 b2, Convertible a4 b3, Convertible a5 b4, Convertible a b5) => (b5 -> b4 -> b3 -> b2 -> b1 -> b -> c) -> a -> a5 -> a4 -> a3 -> a2 -> a1 -> cSource

preconvert7 :: (Convertible a1 b, Convertible a2 b1, Convertible a3 b2, Convertible a4 b3, Convertible a5 b4, Convertible a6 b5, Convertible a b6) => (b6 -> b5 -> b4 -> b3 -> b2 -> b1 -> b -> c) -> a -> a6 -> a5 -> a4 -> a3 -> a2 -> a1 -> cSource