2016-03-03 162 views
2

本定義適用於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給我什麼。

+3

嘗試hoogling'(/)'代替。 –

+6

@DanielWagner應該把它叫做「Froogling」嗎? –

回答

5

Fractional的弗雷格類似物似乎是Real,它提供了兩個操作:

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