Explanation: regular, typebind and autobind operators all use a slightly different syntax, typebind looks like this: '(name : type) >>= expr', autobind looks like this: '(name := expr) >>= expr'.
Error: Operator >>= is a regular operator, but is used as an automatically-binding (autobind) operator.
Test2:14:28--14:31
10 | (>=) : Monad m => m a -> (a -> m b) -> m b
11 | (>=) = (>>=)
12 |
13 | both : Maybe (Nat, Nat) -> Maybe Nat
14 | both m = (MkPair x y := m) >>= Just (x + y)
^^^
Explanation: regular, typebind and autobind operators all use a slightly different syntax, typebind looks like this: '(name : type) >>= expr', autobind looks like this: '(name := expr) >>= expr'.
Possible solutions:
- Write the expression using regular syntax: 'm >>= Just (x + y)'.
- Change the fixity defined at Prelude.Ops:20:1--20:37 to 'export autobind infixl 1 >>='.
- Hide or remove the fixity at Prelude.Ops:20:1--20:37 and import a module that exports a compatible fixity.