Added .crf to every sample-program
This commit is contained in:
parent
9ea3a3dc56
commit
ccfae19541
10 changed files with 23 additions and 23 deletions
24
sample-programs/basic-8.crf
Normal file
24
sample-programs/basic-8.crf
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