summaryrefslogtreecommitdiff
path: root/testsuite/tests/ghc-regress/rename/should_fail/rnfail026.hs
blob: 3256876e68b804d68a2f1335781eac0b230f2270 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
{-# LANGUAGE Rank2Types, FlexibleInstances #-}

-- This one made ghc-4.08 crash 
-- rename/RnEnv.lhs:239: Non-exhaustive patterns in function get_tycon_key
-- The type in the Monad instance is utterly bogus, of course

module ShouldCompile ( Set ) where


data Set a = Set [a]
       deriving (Eq, Ord, Read, Show)

instance Functor Set where
        f `fmap` (Set xs) = Set $ f `fmap` xs

instance Monad (forall a. Eq a => Set a) where
        return x = Set [x]

instance Eq (forall a. [a]) where