summaryrefslogtreecommitdiff
path: root/testsuite/tests/th/T8100.hs
blob: debc2f7166dac640c3286de91c4a1c2ce6ec0ed0 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
{-# LANGUAGE TemplateHaskell, StandaloneDeriving #-}

module T8100 where

import Language.Haskell.TH

data Foo a = Foo a
data Bar = Bar Int

$( do decs <- [d| deriving instance Eq a => Eq (Foo a)
                  deriving instance Ord a => Ord (Foo a) |]
      return ( StandaloneDerivD [] (ConT ''Eq `AppT` ConT ''Bar)
             : StandaloneDerivD [] (ConT ''Ord `AppT` ConT ''Bar)
             : decs ) )

blah :: Ord a => Foo a -> Foo a -> Ordering
blah = compare

buzz :: Bar -> Bar -> Ordering
buzz = compare