blob: c42c1eb33b4cf1fbc83b34975c5eef5877ca37e9 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
|
{-# OPTIONS_GHC -w #-}
{-# LANGUAGE FlexibleInstances, UndecidableInstances #-}
module ShouldCompile where
import Control.Monad.Reader
instance Eq (a -> b) where
_ == _ = error "whoops"
instance Show (a -> b) where
show = const "<fun>"
-- This is the example from Trac #179
foo x = show (\_ -> True)
-- This is the example from Trac #963
instance (Num a, Monad m, Eq (m a), Show (m a)) => Num (m a) where
test = 1 True
|