initial pattern matching implementation. should be somewhat correct
This commit is contained in:
parent
9cd2cdb511
commit
4c015a4aac
3 changed files with 32 additions and 28 deletions
10
test_program
10
test_program
|
|
@ -3,7 +3,13 @@ data Bool () where {
|
|||
False : Bool ()
|
||||
};
|
||||
|
||||
main : Bool () -> _Int ;
|
||||
data Maybe ('a) where {
|
||||
Nothing : Maybe ('a)
|
||||
Just : 'a -> Maybe ('a)
|
||||
};
|
||||
|
||||
main : Bool () -> Maybe (Bool ()) ;
|
||||
main x = case x of {
|
||||
1 => 0
|
||||
True => Nothing;
|
||||
False => Just 0
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue