justinethier / husk-scheme

A full implementation of the Scheme programming language for the Haskell Platform.
http://justinethier.github.io/husk-scheme
MIT License
309 stars 28 forks source link

Display of float values in husk #197

Open justinethier opened 10 years ago

justinethier commented 10 years ago

From Rohan Drape. TBD if this change will be made in Husk, but it is worth considering:

i'm wondering how to work around ghc's (i think infuriating) decisions about when to "show" floats in scientific notation.

ie. "showing" a LispVal that has Float nodes will print 5.0e-2 instead of the (i think more readable) 0.05. S.Float x -> Numeric.showFFloat Nothing x ""

ps. there was a haskell-cafe thread about this but it ended at:

http://www.haskell.org/pipermail/haskell-cafe/2013-November/111318.html


i've made a variant of 'showVal' that works:

  S.Float x -> Numeric.showFFloat Nothing x ""