什么是弗雷格相当于Haskell的分数?

时间:2016-03-03 21:34:25

标签: haskell frege

此定义在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什么都没给我。

1 个答案:

答案 0 :(得分:5)

Fractional的弗雷格模拟似乎是Real,它提供了两种操作:

(/) ∷ Real r ⇒ r → r → r
fromDouble ∷ Real r ⇒ Double → r