Idris2/tests/idris2/operators/operators007/expected

35 lines
1.7 KiB
Plaintext
Raw Normal View History

1/1: Building Test (Test.idr)
Error: Operator >>= is a regular operator, but is used as an automatically-binding (autobind) operator.
Test:10:28--10:31
06 | (>>) : Monad m => m a -> (a -> m b) -> m b
07 | (>>) = (>>=)
08 |
09 | both : Maybe (Nat, Nat) -> Maybe Nat
10 | 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.
- Did you mean '>>' ?
1/1: Building Test2 (Test2.idr)
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.
2024-01-23 19:22:37 +03:00
- Did you mean either of: '>=', '>>' ?