|
Language.Haskell.TH.Lift | Portability | portable | Stability | experimental | Maintainer | forsyde-dev@ict.kth.se |
|
|
|
Description |
Automatically derive Template Haskell's Lift class for datatypes
using Template Haskell splices.
Based on Lynagh's th-lift package: http://hackage.haskell.org/package/th-lift
|
|
Synopsis |
|
|
|
Documentation |
|
|
Automatically generate an instance of Lift for one data type. For example:
{-# LANGUAGE TemplateHaskell #-}
module Colour where
import Language.Haskell.TH.Lift
data RGB = Red | Green | Blue
-- Generate the Lift instance of RGB
$(deriveLift1 ''RGB)
|
|
|
Version of deriveLif1 used to automatically generate instances
of Lift for multiple data types. For instance:
{-# LANGUAGE TemplateHaskell #-}
module Colour where
import Language.Haskell.TH.Lift
data RGB = Red | Green | Blue
data Num a => Pixel a = Pixel a a a
-- Generate Lift instances for RGB and Pixel
$(mapM deriveLift [''RGB, ''Pixel])
|
|
Produced by Haddock version 2.1.0 |