Safe Haskell | None |
---|
- makeLabels :: [String] -> Q [Dec]
- makeLabels3 :: String -> [String] -> Q [Dec]
- makeLabels6 :: [String] -> Q [Dec]
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"
makeLabels6 :: [String] -> Q [Dec]Source
see also makeLabelable