packages feed

remarks-0.1.8: src/Export/Generic.hs

module Export.Generic where

import Text.PrettyPrint

isIntegral :: Double -> Bool
isIntegral x = x == fromInteger (round x)

pointsDoc :: Double -> Doc
pointsDoc v | isNaN v = empty
pointsDoc v | isIntegral v = integer (round v)
pointsDoc v = double v