summaryrefslogtreecommitdiff
path: root/testsuite/tests/typecheck/should_compile/tc049.hs
blob: 20be6b768b3cc11db8d7c34c6f42e8be17b1400f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
module ShouldSucceed where

fib n = if n <= 2 then n else fib (n-1) + fib (n-2)

----------------------------------------

mem x [] = False
mem x (y:ys) = (x == y) `oR` mem x ys

a `oR` b = if a then True else b

----------------------------------------

mem1 x [] = False
mem1 x (y:ys) = (x == y) `oR1` mem2 x ys

a `oR1` b = if a then True else b

mem2 x [] = False
mem2 x (y:ys) = (x == y) `oR` mem1 x ys

---------------------------------------

mem3 x [] = False
mem3 x (y:ys) = if [x] == [y] then mem4 x ys else False

mem4 y (x:xs) = mem3 y xs

---------------------------------------

main1 = [[(1,True)]] == [[(2,False)]]

---------------------------------------

main2 = "Hello" == "Goodbye"

---------------------------------------

main3 = [[1],[2]] == [[3]]