他の質問や問題は似ていますが、これとはまったく異なります。この特定のコンパイラ エラーでは、次の理由により、Haskell GHC は次のコードをコンパイルしません。まったくわかりません。コードはかなり単純です。
--factorial
fact :: int -> int
fact 0 = 1
fact n | n > 0 = n * fact(n - 1)
main = print (fact 10)
(エラー:)
No instance for (Ord int) arising from a use of `>'
Possible fix:
add (Ord int) to the context of
the type signature for fact :: int -> int
In the expression: n > 0
In a stmt of a pattern guard for
an equation for `fact':
n > 0
In an equation for `fact': fact n | n > 0 = n * fact (n - 1)
問題を説明してもらえますか?