summaryrefslogtreecommitdiff
path: root/testsuite/tests/typecheck/should_compile/tc217.hs
blob: 9835da8df1fdcdbba5973f745a73af8fe6a8ec98 (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 #179
foo x = show (\_ -> True)

-- This is the example from #963
instance (Num a, Monad m, Eq (m a), Show (m a)) => Num (m a) where
test = 1 True