added more manual tests
This commit is contained in:
parent
24007313cb
commit
88a4a934b8
6 changed files with 67 additions and 19 deletions
31
test_program
31
test_program
|
|
@ -1,23 +1,24 @@
|
|||
-- data Bool () where {
|
||||
-- True : Bool ()
|
||||
-- False : Bool ()
|
||||
-- };
|
||||
|
||||
data Maybe ('a) where {
|
||||
Nothing : Maybe ('a)
|
||||
Just : 'a -> Maybe ('a)
|
||||
};
|
||||
|
||||
-- main : Bool () -> Maybe (Bool ()) ;
|
||||
-- main x =
|
||||
-- case x of {
|
||||
-- True => Nothing;
|
||||
-- False => Just True
|
||||
-- };
|
||||
|
||||
fun : Maybe ('a) -> 'a ;
|
||||
fun a =
|
||||
fromJust : Maybe ('a) -> 'a ;
|
||||
fromJust a =
|
||||
case a of {
|
||||
Just c => c
|
||||
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