summaryrefslogtreecommitdiff
path: root/testsuite/tests/th/T8100.hs
blob: 355125129945f7d19adf3751597138984edcf8ee (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 Nothing [] (ConT ''Eq `AppT` ConT ''Bar)
             : StandaloneDerivD Nothing [] (ConT ''Ord `AppT` ConT ''Bar)
             : decs ) )

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

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