added file suffix and check
This commit is contained in:
parent
ac43af8110
commit
d49e2401bf
2 changed files with 42 additions and 25 deletions
28
test_program
28
test_program
|
|
@ -1,28 +0,0 @@
|
|||
data Maybe (a) where {
|
||||
Nothing : Maybe (a)
|
||||
Just : a -> Maybe (a)
|
||||
};
|
||||
|
||||
fmap : (a -> b) -> Maybe (a) -> Maybe (b) ;
|
||||
fmap f ma = case ma of {
|
||||
Nothing => Nothing ;
|
||||
Just a => Just (f a) ;
|
||||
};
|
||||
|
||||
pure : a -> Maybe (a) ;
|
||||
pure x = Just x ;
|
||||
|
||||
ap mf ma = case mf of {
|
||||
Just f => case ma of {
|
||||
Nothing => Nothing;
|
||||
Just a => Just (f a);
|
||||
};
|
||||
Nothing => Nothing;
|
||||
};
|
||||
|
||||
return = pure;
|
||||
|
||||
bind ma f = case ma of {
|
||||
Nothing => Nothing ;
|
||||
Just a => f a ;
|
||||
};
|
||||
Loading…
Add table
Add a link
Reference in a new issue