Module ShowS

This library provides a type and combinators for show functions using functional lists.

Author: Bjoern Peemoeller

Version: April 2016

Summary of exported operations:

showString :: String -> String -> String   
Prepend a string
showChar :: Char -> String -> String   
Prepend a single character
showParen :: Bool -> (String -> String) -> String -> String   
Surround the inner show function with parentheses if the first argument evaluates to True.
shows :: Show a => a -> String -> String   
Convert a value to ShowS using the standard show function.
space :: String -> String   
Prepend a space
nl :: String -> String   
Prepend a newline
sep :: (String -> String) -> [String -> String] -> String -> String   
Separate a list of ShowS
replicateS :: Int -> (String -> String) -> String -> String   
Replicate a ShowS a given number of times
concatS :: [String -> String] -> String -> String   
Concatenate a list of ShowS

Exported datatypes:


ShowS

Type synonym: ShowS = String -> String


Exported operations:

showString :: String -> String -> String   

Prepend a string

Properties:

showString s [] -=- s (showStringIsString)
(showString s1 . showString s2) [] -=- (s1 ++ s2) (showStringConcat)

Further infos:
  • solution complete, i.e., able to compute all solutions

showChar :: Char -> String -> String   

Prepend a single character

Further infos:
  • solution complete, i.e., able to compute all solutions

showParen :: Bool -> (String -> String) -> String -> String   

Surround the inner show function with parentheses if the first argument evaluates to True.

shows :: Show a => a -> String -> String   

Convert a value to ShowS using the standard show function.

space :: String -> String   

Prepend a space

Further infos:
  • solution complete, i.e., able to compute all solutions

nl :: String -> String   

Prepend a newline

Further infos:
  • solution complete, i.e., able to compute all solutions

sep :: (String -> String) -> [String -> String] -> String -> String   

Separate a list of ShowS

replicateS :: Int -> (String -> String) -> String -> String   

Replicate a ShowS a given number of times

Properties:

(n >= 0) ==> (replicateS n (showString s) [] -=- concat (replicate n s)) (replicateSIsConRep)

concatS :: [String -> String] -> String -> String   

Concatenate a list of ShowS

Properties:

concatS (map showString xs) [] -=- concat xs (concatSIsConcat)