elm/compiler/SourceSyntax/PrettyPrint.hs
Evan Czaplicki b5887f41c9 Get type inference working in the basic case. Begin working on
printing errors in a prettier way.
2013-07-10 14:31:57 +02:00

18 lines
No EOL
356 B
Haskell

module SourceSyntax.PrettyPrint where
import Text.PrettyPrint
import SourceSyntax.Location
class Pretty a where
pretty :: a -> Doc
instance Pretty a => Pretty (Located a) where
pretty (L _ _ e) = pretty e
instance Pretty () where
pretty () = empty
commaCat docs = cat (punctuate comma docs)
parensIf bool doc = if bool then parens doc else doc