0

私は独自の演算子を定義しました:

infixr 6 >+
x >+ y = (+ x) y

まさに連想です。

そして今、次の式で使用したいと思います:

(`mod` 14) (>+ 5) 10

しかし、私はエラーが発生します:

<interactive>:11:1:
    Non type-variable argument in the constraint: Integral (a -> a)
    (Use FlexibleContexts to permit this)
    When checking that ‘it’ has the inferred type
      it :: forall a. (Integral (a -> a), Num a) => a

どうすれば修正できますか?

4

1 に答える 1