mirror of
https://github.com/idris-lang/Idris2.git
synced 2024-12-19 09:12:34 +03:00
15 lines
256 B
Idris
15 lines
256 B
Idris
|
|
import Data.Fin
|
|
|
|
autobind infixr 0 >>
|
|
autobind infixr 0 >=
|
|
|
|
(>>) : Monad m => m a -> (a -> m b) -> m b
|
|
(>>) = (>>=)
|
|
|
|
(>=) : Monad m => m a -> (a -> m b) -> m b
|
|
(>=) = (>>=)
|
|
|
|
both : Maybe (Nat, Nat) -> Maybe Nat
|
|
both m = (MkPair x y := m) >>= Just (x + y)
|