hets -- a heterogenous Specification (CASL) tool setContentsIndex
Common.SimpPretty
Portability portable
Stability provisional
Maintainer hets@tzi.de
Contents
The document type
Primitive SDocuments
Converting values into documents
Wrapping documents in delimiters
Combining documents
Predicates on documents
Rendering documents
Description

An imported and simplified version of GHC module

GHCs documentation follows

Synopsis
data SDoc
empty :: SDoc
comma :: SDoc
text :: String -> SDoc
char :: Char -> SDoc
integer :: Integer -> SDoc
parens :: SDoc -> SDoc
brackets :: SDoc -> SDoc
braces :: SDoc -> SDoc
(<>) :: SDoc -> SDoc -> SDoc
punctuate :: SDoc -> [SDoc] -> [SDoc]
isEmpty :: SDoc -> Bool
render :: SDoc -> String
fullRender :: (TextDetails -> a -> a) -> (a -> a -> a) -> a -> SDoc -> a
writeFileSDoc :: FilePath -> SDoc -> IO ()
data TextDetails
= Chr !Char
| Str !String
The document type
data SDoc
The abstract type of documents
Instances
Show SDoc
Primitive SDocuments
empty :: SDoc
An empty document
comma :: SDoc
A ',' character
Converting values into documents
text :: String -> SDoc
char :: Char -> SDoc
integer :: Integer -> SDoc
Wrapping documents in delimiters
parens :: SDoc -> SDoc
Wrap document in (...)
brackets :: SDoc -> SDoc
Wrap document in [...]
braces :: SDoc -> SDoc
Wrap document in {...}
Combining documents
(<>) :: SDoc -> SDoc -> SDoc
Beside
punctuate :: SDoc -> [SDoc] -> [SDoc]
punctuate p [d1, ... dn] = [d1 <> p, d2 <> p, ... dn-1 <> p, dn]
Predicates on documents
isEmpty :: SDoc -> Bool
Returns True if the document is empty
Rendering documents
render :: SDoc -> String
Renders the document as a string using the default style
fullRender
:: (TextDetails -> a -> a)What to do with text
-> (a -> a -> a)Compose two a
-> aWhat to do at the end
-> SDocThe document
-> aResult
writeFileSDoc :: FilePath -> SDoc -> IO ()
data TextDetails
Constructors
Chr !Char
Str !String
Produced by Haddock version 0.6