Idris2/tests/idris2/operators/operators007/Test2.idr

15 lines
256 B
Idris
Raw Normal View History

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)