PrettyDoc

Plain source file: base/pretty/PrettyDoc.hs (2003-01-25)

PrettyDoc is imported by: NewPrettyPrint, PrettyPrint2.

module PrettyDoc where
import TokenTags

data Layout = Horiz Sep | Vert | HorizOrVert Sep | Fill Sep deriving (Show)
data Sep = Cat | Sep deriving (Show)

nonEmpty Empty = False
nonEmpty d = True

data Doc
  = Empty
  | Char Char
  | Text String
  | Attr TokenTag Doc
  | Nest Int Doc
  | Group Layout [Doc]
  deriving (Show)

{-
class Doc doc where
  -- Required methods:
  empty :: doc
  text :: String->doc
  nest :: Int->doc->doc
  group :: Layout->[doc]->doc

  -- Methods with default implementations:
  char :: Char->doc
  char c = text [c]
-}

Index

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