hets -- a heterogenous Specification (CASL) tool setContentsIndex
Common.PPUtils
Portability portable
Stability provisional
Maintainer hets@tzi.de
Description

Useful functions for pretty printing that will be allmost useful for many logics.

Todo: - Add your own functions.

Synopsis
data WrapString = WrapString String
class ListCheck a where
innerListGT :: a -> Int -> Bool
pluralS :: ListCheck a => [a] -> String
pluralS_doc :: ListCheck a => [a] -> Doc
sp_hang :: Doc -> Int -> Doc -> Doc
sp_brackets :: Doc -> Doc
sp_braces :: Doc -> Doc
sp_between :: Doc -> Doc -> Doc -> Doc
prepPunctuate :: Doc -> [Doc] -> [Doc]
commaT_text :: PrettyPrint a => GlobalAnnos -> [a] -> Doc
semiT_text :: PrettyPrint a => GlobalAnnos -> [a] -> Doc
crossT_text :: PrettyPrint a => GlobalAnnos -> [a] -> Doc
listSep_text :: PrettyPrint a => Doc -> GlobalAnnos -> [a] -> Doc
semiAnno_text :: PrettyPrint a => GlobalAnnos -> [Annoted a] -> Doc
commaT_latex :: PrettyPrint a => GlobalAnnos -> [a] -> Doc
semiT_latex :: PrettyPrint a => GlobalAnnos -> [a] -> Doc
crossT_latex :: PrettyPrint a => GlobalAnnos -> [a] -> Doc
listSep_latex :: PrettyPrint a => Doc -> GlobalAnnos -> [a] -> Doc
semiAnno_latex :: PrettyPrint a => GlobalAnnos -> [Annoted a] -> Doc
tabList_latex :: [Doc] -> [Doc]
hc_sty_casl_keyword :: String -> Doc
sp_hang_latex :: Doc -> Int -> Doc -> Doc
sp_between_latex :: Doc -> Doc -> Doc -> Doc
sp_braces_latex :: Doc -> Doc
sp_braces_latex2 :: Doc -> Doc
sp_brackets_latex :: Doc -> Doc
simple_id_latex :: SIMPLE_ID -> Doc
simple_id_indexed_latex :: SIMPLE_ID -> Doc
parens_tab_latex :: Doc -> Doc
startTab_latex :: Doc
endTab_latex :: Doc
setTab_latex :: Doc
setTabWithSpaces_latex :: Int -> Doc
tabbed_nest_latex :: Doc -> Doc
set_tabbed_nest_latex :: Doc -> Doc
tab_nest_latex :: Int -> Doc -> Doc
tab_hang_latex :: Doc -> Int -> Doc -> Doc
printSet :: PrettyPrint a => GlobalAnnos -> Set a -> Doc
printListSet :: PrettyPrint a => GlobalAnnos -> Bool -> [a] -> Doc
printMap :: (PrettyPrint k, PrettyPrint a) => GlobalAnnos -> [(k, a)] -> Doc
module Common.LaTeX_funs
hspace_latex :: String -> Doc
Documentation
data WrapString
a helper type to pretty print (wrapped) strings
Constructors
WrapString String
Instances
Show WrapString
PrettyPrint WrapString
class ListCheck a where
a helper class for calculating the pluralS of e.g. ops
Methods
innerListGT :: a -> Int -> Bool
Instances
ListCheck SIG_ITEMS
ListCheck SORT_ITEM
ListCheck OP_ITEM
ListCheck PRED_ITEM
ListCheck DATATYPE_DECL
ListCheck VAR_DECL
ListCheck a => ListCheck (Annoted a)
pluralS :: ListCheck a => [a] -> String
pluralS checks a list with elements in class ListCheck for a list greater than zero. It returns an empty String if the list and all nested lists have only one element. If the list or an nested list has more than one element a String containig one s is returned.
pluralS_doc :: ListCheck a => [a] -> Doc
sp_hang :: Doc -> Int -> Doc -> Doc
another hang function. This functions concats the documents if the line has enough space left instead of seperating with a space.
sp_brackets :: Doc -> Doc
only prints the brackets near to the enclosed document if all fits in one line otherwise the brackets stand alone and aligned one their own lines and the enclosed document is nested one charcter wide.
sp_braces :: Doc -> Doc
sp_between :: Doc -> Doc -> Doc -> Doc
prepPunctuate :: Doc -> [Doc] -> [Doc]
like punctuate from Pretty, but prepends symbol to every element omitting the first element
commaT_text :: PrettyPrint a => GlobalAnnos -> [a] -> Doc
the functions commaT, semiT, crossT and semiAnno are good for ASCII pretty printing but don't work well for LaTeX output.
semiT_text :: PrettyPrint a => GlobalAnnos -> [a] -> Doc
crossT_text :: PrettyPrint a => GlobalAnnos -> [a] -> Doc
listSep_text :: PrettyPrint a => Doc -> GlobalAnnos -> [a] -> Doc
semiAnno_text :: PrettyPrint a => GlobalAnnos -> [Annoted a] -> Doc
commaT_latex :: PrettyPrint a => GlobalAnnos -> [a] -> Doc
LaTeX variants of commaT ...
semiT_latex :: PrettyPrint a => GlobalAnnos -> [a] -> Doc
crossT_latex :: PrettyPrint a => GlobalAnnos -> [a] -> Doc
listSep_latex :: PrettyPrint a => Doc -> GlobalAnnos -> [a] -> Doc
semiAnno_latex :: PrettyPrint a => GlobalAnnos -> [Annoted a] -> Doc
tabList_latex :: [Doc] -> [Doc]
hc_sty_casl_keyword :: String -> Doc
sp_hang_latex :: Doc -> Int -> Doc -> Doc
sp_between_latex :: Doc -> Doc -> Doc -> Doc
sp_braces_latex :: Doc -> Doc
sp_braces_latex2 :: Doc -> Doc
sp_brackets_latex :: Doc -> Doc
simple_id_latex :: SIMPLE_ID -> Doc
simple_id_indexed_latex :: SIMPLE_ID -> Doc
parens_tab_latex :: Doc -> Doc
startTab_latex :: Doc
constant document to start indentation by a LaTeX tab stop
endTab_latex :: Doc
constant document to end indentation by a LaTeX tab stop
setTab_latex :: Doc
constant document to set a LaTeX tab stop at this position
setTabWithSpaces_latex :: Int -> Doc
tabbed_nest_latex :: Doc -> Doc
function for nice indentation
set_tabbed_nest_latex :: Doc -> Doc
function for nice indentation together with starting
tab_nest_latex :: Int -> Doc -> Doc
tab_hang_latex :: Doc -> Int -> Doc -> Doc
printSet :: PrettyPrint a => GlobalAnnos -> Set a -> Doc
print a set without enclosing braces
printListSet :: PrettyPrint a => GlobalAnnos -> Bool -> [a] -> Doc
printMap :: (PrettyPrint k, PrettyPrint a) => GlobalAnnos -> [(k, a)] -> Doc
module Common.LaTeX_funs
hspace_latex :: String -> Doc
makes a hspace*{String} as Doc with appropiate size
Produced by Haddock version 0.6