forsyde-deep-0.2.0: ForSyDe's Haskell-embedded Domain Specific Language.

Copyright(c) Ian Lynagh, 2006, (c) SAM Group, KTH/ICT/ECS 2007-2008
LicenseBSD-style (see the file LICENSE)
Maintainerforsyde-dev@ict.kth.se
Stabilityexperimental
Portabilityportable
Safe HaskellNone
LanguageHaskell98

Language.Haskell.TH.Lift

Contents

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/cgi-bin/hackage-scripts/package/th-lift

Synopsis

Documentation

deriveLift1 :: Name -> Q [Dec] Source #

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)

deriveLift :: Name -> Q Dec Source #

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])

Orphan instances