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

11 lines
178 B
Idris

import Data.Fin
autobind infixr 0 >>
(>>) : Monad m => m a -> (a -> m b) -> m b
(>>) = (>>=)
both : Maybe (Nat, Nat) -> Maybe Nat
both m = (MkPair x y := m) >>= Just (x + y)