summaryrefslogtreecommitdiff
path: root/testsuite/tests/th/T18123.hs
blob: e705ec44808ba687618ed4bdc8ea6732b3266709 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
{-# LANGUAGE TemplateHaskell, StandaloneDeriving #-}
module T18123 where

import Language.Haskell.TH

data Point = MkPoint { _x, _y :: Double }
data Rect = MkRect { _p1, _p2 :: Point }

let
    deriveEq :: Name -> DecsQ
    deriveEq name = [d| deriving instance Eq $(conT name) |]
 in
    foldMap deriveEq [ ''Point, ''Rect ]