7
votes

If I enter ":i Double" or ":i Float" in ghci, it says that Double and Float are instances of Fractional. But in the Haskell docs it says that they aren't. So are they or not? http://hackage.haskell.org/package/base-4.9.1.0/docs/Prelude.html#t:Fractional

1
They are -- :i is reliable, they are listed as instances of Floating (which has Fractional as superclass), and if you go to the source code for Double's Floating instance you will find the Fractional one a few lines above. This does look like a documentation/Haddock bug of some sort, though -- the instances should have been listed there.duplode
(This seems to be a known Haddock bug -- cf. Haddock issue #372.)duplode

1 Answers

11
votes
  • Double and Float are a part of RealFloat,
    • which extends RealFrac and Floating;
      • both of which extend Fractional.