此定义在ghci
:
recip :: Fractional a ⇒ a → a
recip n = 1 / n
在frege-repl
中尝试了我:
E <console>.fr:6: can't resolve `Fractional`, did you mean `Exceptional`
perhaps?
"Hoogling" Fractional
什么都没给我。
答案 0 :(得分:5)
Fractional
的弗雷格模拟似乎是Real
,它提供了两种操作:
(/) ∷ Real r ⇒ r → r → r
fromDouble ∷ Real r ⇒ Double → r