HList-0.3.4.1: Heterogeneous lists

Safe HaskellNone

Data.HList.MakeLabels

Description

 

Synopsis

Documentation

makeLabels :: [String] -> Q [Dec]Source

Labels like Data.HList.Label4 used to provide (only no Typeable).

The following TH declaration splice should be placed at top-level, before the created values are used. Enable -XTemplateHaskell too.

  makeLabels ["getX","getY","draw","X"]

should expand into the following declarations

 data LabelGetX
 data LabelGetY
 data LabelDraw
 data LabelX
 getX = Label :: Label LabelGetX
 getY = Label :: Label LabelGetY
 draw = Label :: Label LabelDraw
 x    = Label :: Label LabelX
 instance ShowLabel LabelGetX where showLabel = \_ -> "getX"
 instance ShowLabel LabelGetY where showLabel = \_ -> "getY"
 instance ShowLabel LabelDraw where showLabel = \_ -> "draw"

makeLabels3Source

Arguments

:: String

namespace

-> [String]

labels

-> Q [Dec] 

see also makeLabelable