mirror of
https://github.com/idris-lang/Idris2.git
synced 2024-12-24 04:09:10 +03:00
a972778eab
They don't all pass yet, for minor reasons. Coming shortly... Unfortunately the startup overhead for chez is really noticeable here!
16 lines
414 B
Idris
16 lines
414 B
Idris
import Stuff
|
|
|
|
(>>=) : (Maybe a) -> (a -> Maybe b) -> Maybe b
|
|
(>>=) Nothing k = Nothing
|
|
(>>=) (Just x) k = k x
|
|
|
|
mthings : (foo : Maybe (Maybe Int)) -> (bar : Maybe (Maybe Int)) -> Maybe Int
|
|
mthings mx my
|
|
= do Just x <- mx
|
|
| Nothing => Just 0
|
|
Just y <- my
|
|
| Nothing => Just 1
|
|
let z : Int -> Int
|
|
z x = prim__add_Int x y
|
|
Just (z (prim__add_Int x x))
|