added more manual tests
This commit is contained in:
parent
24007313cb
commit
88a4a934b8
6 changed files with 67 additions and 19 deletions
24
sample-programs/basic-8
Normal file
24
sample-programs/basic-8
Normal file
|
|
@ -0,0 +1,24 @@
|
|||
data Maybe ('a) where {
|
||||
Nothing : Maybe ('a)
|
||||
Just : 'a -> Maybe ('a)
|
||||
};
|
||||
|
||||
fromJust : Maybe ('a) -> 'a ;
|
||||
fromJust a =
|
||||
case a of {
|
||||
Just a => a
|
||||
};
|
||||
|
||||
fromMaybe : 'a -> Maybe ('a) -> 'a ;
|
||||
fromMaybe a b =
|
||||
case b of {
|
||||
Just a => a;
|
||||
Nothing => a
|
||||
};
|
||||
|
||||
maybe : 'b -> ('a -> 'b) -> Maybe ('a) -> 'b;
|
||||
maybe b f ma =
|
||||
case ma of {
|
||||
Just a => f a;
|
||||
Nothing => b
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue