summaryrefslogtreecommitdiff
path: root/testsuite/tests/deriving/should_fail/drvfail002.hs
blob: cdaaa5d6be98afee376eb459d3953ff8ce56c5fb (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
{-# LANGUAGE UndecidableInstances, FlexibleContexts,
             MultiParamTypeClasses, FunctionalDependencies #-}

-- The Show instance for S would have form
--      instance X T c => Show S
-- which is hard to deal with.  It sent GHC 5.01 into
-- an infinite loop; now it should be rejected.

module ShouldFail where

data T = T Integer

class X a b | a -> b where
    f :: a -> b

instance X T c => Show T where
    show _ = ""

data S = S T deriving Show