Where can I find the fromRealFrac
function? According to the gentle intro the function should exist and from a bit of googling around, I gather it should be in Prelude - yet ghci complains that it's not in scope.
I'm using fromRational . toRational
for the time being, as according to the gentle intro that's how fromRealFrac
is meant to be defined.
Realtrac is an on-premise job management solution designed for job shop manufacturers and modular machine shops. It helps small and midsize manufacturers to schedule workflows, manage shop operations, track inventories, manage purchases and report business operations.
REALTORS® have spent millions of dollars to develop Multiple Listing Services (MLS) and other real estate technologies that make the transaction more efficient. An MLS is a private offer of cooperation and compensation by listing brokers to other real estate brokers.
The function formerly known as "fromRealFrac" was renamed "realToFrac" in the Haskell 98 Report.
In the Haskell 1.4 Prelude we find
fromRealFrac :: (RealFrac a, Fractional b) => a -> b
fromRealFrac = fromRational . toRational
However, by Haskell 98 it is known as
realToFrac :: (Real a, Fractional b) => a -> b
realToFrac = fromRational . toRational
This change is listed in the Haskell 98 Report Errata:
[Apr 2001] Page 84, Section 6.4, Fig 7; and bottom of page 86, Section 6.4.6.
fromRealFrac :: (RealFrac a, Fractional b) => a -> b
should be replaced by
realToFrac :: (Real a, Fractional b) => a -> b
The closest commit I could find was this in the report repo.
It appears this function is called realToFrac
in the GHC Prelude.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With