Testsuite: tabs -> spaces [skip ci]
[ghc.git] / testsuite / tests / typecheck / should_run / TcRun025_B.hs
1 {-# LANGUAGE ImplicitParams, TypeSynonymInstances, FlexibleInstances, ConstrainedClassMethods #-}
2
3 -- Similar to tc024, but cross module
4
5 module TcRun025_B where
6
7 import Data.List( sort )
8
9 -- This class has no tyvars in its class op context
10 -- One uses a newtype, the other a data type
11 class C1 a where
12 fc1 :: (?p :: String) => a;
13 class C2 a where
14 fc2 :: (?p :: String) => a;
15 opc :: a
16
17 instance C1 String where
18 fc1 = ?p;
19 instance C2 String where
20 fc2 = ?p;
21 opc = "x"
22
23 -- This class constrains no new type variables in
24 -- its class op context
25 class D1 a where
26 fd1 :: (Ord a) => [a] -> [a]
27 class D2 a where
28 fd2 :: (Ord a) => [a] -> [a]
29 opd :: a
30
31 instance D1 (Maybe a) where
32 fd1 xs = sort xs
33 instance D2 (Maybe a) where
34 fd2 xs = sort xs
35 opd = Nothing
36
37
38