SCC analysis for instances as well as types/classes
[ghc.git] / testsuite / tests / typecheck / should_compile / tc127.hs
1 {-# LANGUAGE ImplicitParams #-}
2
3 -- !!! Another implicit parameter test, from Alastair Reid
4
5 module ShouldCompile where
6
7 import Data.Maybe
8
9 type Env = ([(String,Int)],Int)
10
11 ident1 :: (?env :: Env) => String -> Int
12 ident1 x = y
13 where
14 env = ?env
15 y = fromJust (lookup x (fst env))
16
17 ident2 :: (?env :: Env) => String -> Int
18 ident2 x = y
19 where
20 y = fromJust (lookup x (fst ?env))
21
22
23 -- Two more tests from Jeff Lewis
24 x () = y where y = ?wibble
25
26 f () = ?wibble :: Int
27 g () = f ()