JSON and CSV encoding for rationals as decimal point numbers.

Version on this page:1.0.0
LTS Haskell 13.25:1.0.0
Stackage Nightly 2019-06-12:1.0.0
Latest on Hackage:1.0.0

See all snapshots detour-via-sci appears in

MPL-2.0 licensed by Phil de Joux
Maintained by

Module documentation for 1.0.0


For encoding and decoding newtype rationals as scientific with a fixed number of decimal places.



Initial version with;

  • toSci and fromSci for converting Rational to and from Scientific.
  • showSci for showing Rational as if Scientific.
  • For JSON, instances of ToJSON and FromJSON for newtype Rational that also have instances of DefaultDecimalPlaces and NewType.
  • For CSV, instances of ToField and FromField in the same way.
  • Template Haskell functions to generate instances.
comments powered byDisqus