-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmler.3.sml
38 lines (31 loc) · 1.05 KB
/
mler.3.sml
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
datatype pizza =
Crust
| Cheese of pizza
| Onion of pizza
| Anchovy of pizza
| Sausage of pizza;
fun remove_anchovy (Crust)
= Crust
| remove_anchovy (Cheese (x))
= Cheese(remove_anchovy (x))
| remove_anchovy (Onion (x))
= Onion(remove_anchovy (x))
| remove_anchovy (Anchovy (x))
= remove_anchovy (x)
| remove_anchovy (Sausage (x))
= Sausage(remove_anchovy (x));
remove_anchovy (Sausage (Onion (Anchovy (Cheese (Anchovy (Crust))))));
fun top_anchovy_with_cheese (Crust)
= Crust
| top_anchovy_with_cheese (Cheese (x))
= Cheese(top_anchovy_with_cheese (x))
| top_anchovy_with_cheese (Onion (x))
= Onion(top_anchovy_with_cheese (x))
| top_anchovy_with_cheese (Anchovy (x))
= Cheese (Anchovy (top_anchovy_with_cheese (x)))
| top_anchovy_with_cheese (Sausage (x))
= Sausage(top_anchovy_with_cheese (x));
top_anchovy_with_cheese;
top_anchovy_with_cheese (Crust);
top_anchovy_with_cheese (Anchovy (Crust));
top_anchovy_with_cheese (Sausage (Anchovy (Onion (Cheese (Anchovy (Crust))))));