summaryrefslogtreecommitdiff
path: root/testsuite/tests/typecheck/should_compile/tc079.hs
blob: 0aa9015f5238cc5fa601bb9b64fe94388f316ac4 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
{-# OPTIONS_GHC -fno-warn-redundant-constraints #-}

-- !!! small class decl with local polymorphism;
-- !!! "easy" to check default methods and such...
-- !!! (this is the example given in GHC.Tc.TyCl.Class)
--
module ShouldSucceed where

class Foo a where
    op1 :: a -> Bool
    op2 :: Ord b => a -> b -> b -> b

    op1 x = True
    op2 x y z = if (op1 x) && (y < z) then y else z

instance Foo Int where {}

instance Foo a => Foo [a] where {}