[project @ 2001-05-03 12:30:35 by simonpj]
[ghc-hetmet.git] / ghc / tests / typecheck / should_compile / tc127.hs
1 {-# OPTIONS -fglasgow-exts #-}
2
3 -- !!! Another implicit parameter test, from Alastair Reid
4
5 module ShouldCompile where
6
7 import 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 ()