2
*> sin sin 0.5
<interactive>:10:1:
Non type-variable argument in the constraint: Floating (a -> a)
(Use FlexibleContexts to permit this)
When checking that ‘it’ has the inferred type
it :: forall a. (Floating a, Floating (a -> a)) => a
しかし、sin (sin 0.5)
の作品です。
私はそれらが同一であり、エラーメッセージを理解できないと思います。
なぜ知りたいですか?haskellの `sin sin 0.5`と` sin(sin 0.5) `の違いは何ですか?
これらは同一ではありません。関数の適用は左結合であるため、「sin sin 0.5」は実際には(sin sin 0.5)であり、これはあなたが意味するものではなく型エラーにつながります。 – duplode
[Haskellの優先順位規則が複数の部分的なアプリケーションでどのように動作するかの理解]の部分的な複製(http://stackoverflow.com/questions/17243075/understanding-how-haskell-precedence-rules-work-with-multiple-partial-applicatio) – duplode