HsLiteralPretty

Plain source file: base/AST/HsLiteralPretty.hs (2004-12-18)

HsLiteralPretty is imported by: BaseSyntaxPretty, HsExpPretty, HsPatPretty.

module HsLiteralPretty where
import HsLiteral
import PrettyPrint

instance Printable HsLiteral where
    ppi	(HsInt i)        = ppi i
    ppi	(HsChar c)       = ppi (show c) --litChar c
    ppi	(HsString s)     = ppi (show s) --litString s
    ppi	(HsFrac r)       = ppi r
    -- GHC unboxed literals:
    ppi (HsCharPrim c)   = show c                  <> '#'
    ppi (HsStringPrim s) = show s                  <> '#'
    ppi (HsIntPrim i)    = ppi i                   <> '#'
    ppi (HsFloatPrim r)  = float  (fromRational r) <> '#'
    ppi (HsDoublePrim r) = double (fromRational r) <> "##"
    -- GHC extension:
    ppi (HsLitLit s)     = doubleQuotes s

    wrap = ppi

Index

(HTML for this module was generated on 2006-08-12. About the conversion tool.)