mirror of
https://github.com/edwinb/Idris2-boot.git
synced 2024-12-21 11:51:31 +03:00
e6121e0935
This is the result of running the command: $ find . -name '*.idr' -type f -exec sed -i -E 's/\s+$//' {} + I confirmed before running it that this would not affect any markdown formatting in documentation comments.
16 lines
304 B
Idris
16 lines
304 B
Idris
public export
|
|
interface Do (m : Type) where
|
|
Next : m -> Type
|
|
bind : (x : m) -> Next x
|
|
|
|
public export
|
|
Monad m => Do (m a) where
|
|
Next x = {b : Type} -> (a -> m b) -> m b
|
|
bind x k = x >>= k
|
|
|
|
foo : Maybe Int -> Maybe Int -> Maybe Int
|
|
foo x y
|
|
= bind x (\x' =>
|
|
bind y (\y' => Just (x' + y')))
|
|
|