<div dir="ltr"><div>This has nothing to do with Parsec or Decimal. Two things are happening:</div><div><br></div><div>First, the type of the literal 3.14 is Fractional a => a. GHCi's extended default rules [1] pick Double as the default for Fractional. (This is a good choice.) Second, the closest number to 4.14 that is reresentable as a Double is <span style="font-size:13px">4.1400000000000001. This is an inherent limitation of the representation used. This effects every use of floating point numbers in every programming language, and every programmer should understand this. See [2] for more information.</span></div><div><span style="font-size:13px"><br></span></div><div><span style="font-size:13px">For an exact result, you can provide a different type for your Fractional literal that is capable of representing the result exactly:</span></div><div><span style="font-size:13px"><br></span></div><div><span style="font-size:13px">> </span>succ 3.14 :: Rational</div><div><br></div><div>207 % 50<br></div><div><span style="font-size:13px"><br></span></div><div>> There must be some reason why Float and Double implement the Enum class,<br></div><span>> but I can't understand in what sense (mathematically) are real numbers<br>enumerable</span><div><span><br></span></div><div dir="ltr"><div><span>You're absolutely right. It is, at best, a kludge and has no mathematical justification.</span></div><div><span><br></span></div><div><span><span><div><span style="font-size:13px">[1] </span><a href="https://downloads.haskell.org/~ghc/latest/docs/html/users_guide/interactive-evaluation.html#extended-default-rules">https://downloads.haskell.org/~ghc/latest/docs/html/users_guide/interactive-evaluation.html#extended-default-rules</a></div><div>[2] <a href="https://docs.oracle.com/cd/E19957-01/806-3568/ncg_goldberg.html">https://docs.oracle.com/cd/E19957-01/806-3568/ncg_goldberg.html</a></div><div><br></div></span><br></span></div></div><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><br>
</blockquote></div></div>