Idris2/tests/idris2/operators/operators007/Test2.idr
2024-02-24 12:36:44 +00:00

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)