[Haskell-cafe] Re: pi
dbenbenn at gmail.com
Wed Oct 10 20:45:57 EDT 2007
On 10/10/07, Dan Weston <westondan at imageworks.com> wrote:
> Actually, it is a constant: piDecimalExpansion :: String.
Where is this constant defined?
> A translation from piDecimalExpansion :: String to pi :: Floating a => a
> is already well defined via read :: Read a => String -> a
> Any definition of pi in the Floating class that differs from (read
> piDecimalExpansion) is erroneous. I propose the above as the default
> definition of pi.
piDecimalExpansion, if defined, would be an infinite length string.
read $ "0." ++ repeat '1' :: Double
is Bottom. So even if you had piDecimalExpansion, it isn't clear how
to use that to define pi.
More information about the Haskell-Cafe