Ошибка «Нет экземпляра для»

Следуя примеру из http://en.wikibooks.org/wiki/Haskell/Beginning

Prelude> let abs x = if x < 0 then -x else x
Prelude> abs 5
5
Prelude> abs -3

:1:6:
    No instance for (Num (a0 -> a0))
      arising from the literal `3'
    Possible fix: add an instance declaration for (Num (a0 -> a0))
    In the second argument of `(-)', namely `3'
    In the expression: abs - 3
    In an equation for `it': it = abs - 3

Что не так?

6
задан zaf 3 June 2011 в 07:27
поделиться