[project @ 1996-01-08 20:28:12 by partain]
[ghc-hetmet.git] / ghc / compiler / tests / typecheck / should_succeed / tc049.hs
1 module ShouldSucceed where
2
3 fib n = if n <= 2 then n else fib (n-1) + fib (n-2)
4
5 ----------------------------------------
6
7 mem x [] = False
8 mem x (y:ys) = (x == y) `oR` mem x ys
9
10 a `oR` b = if a then True else b
11
12 ----------------------------------------
13
14 mem1 x [] = False
15 mem1 x (y:ys) = (x == y) `oR1` mem2 x ys
16
17 a `oR1` b = if a then True else b
18
19 mem2 x [] = False
20 mem2 x (y:ys) = (x == y) `oR` mem1 x ys
21
22 ---------------------------------------
23
24 mem3 x [] = False
25 mem3 x (y:ys) = if [x] == [y] then mem4 x ys else False
26
27 mem4 y (x:xs) = mem3 y xs
28
29 ---------------------------------------
30
31 main1 = [[(1,True)]] == [[(2,False)]]
32
33 ---------------------------------------
34
35 main2 = "Hello" == "Goodbye"
36
37 ---------------------------------------
38
39 main3 = [[1],[2]] == [[3]]