-
Notifications
You must be signed in to change notification settings - Fork 0
/
Test.hpr
56 lines (35 loc) · 849 Bytes
/
Test.hpr
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
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
module Test () where
{-
f :: a -> a
f x = x
g = (\_ _ -> 3) (f 3) (f "")
data List a = Cons a (List a) | Nil
map :: (a->b)->List a->List b
map f (Cons x xs) = Cons (f x) (map f xs)
map _ Nil = Nil
--The order in which I put the cases determines whether
--the bug appears.
foldr op id (Cons x xs) = op x (foldr op id xs)
foldr _ id _ = id
sametype :: a -> a -> Bool
sametype x y = True
data Bool = True | False
char = if True then 1 else 0
name_underscore = 1
data TypeUnderscore = NoCon
-}
data B = T | F
f T = T
{-rcv = case receive of
_ -> "yoohoo!"
After Infinity -> "cool!"-}
urcv = case receive of
3 -> "yoop"
After Infinity -> "nay man"
data Either = Left B | Right Number
exp = case Left T of
Left x -> ignore x
Right x -> ignore x
ignore _ = 0
impl :: Implicit t -> t
impl = impl