Safe Haskell | None |
---|

- newtype Code = Code {}
- showCode :: Code -> String
- class Codeable a where
- class CodeList a where
- noCode :: Code
- line :: Code
- isNull :: Codeable a => a -> Bool
- numLines :: CodeList a => a -> Int
- singleLine :: CodeList a => a -> Bool
- indent :: Codeable a => Int -> a -> Code
- surround :: Codeable a => String -> String -> a -> Code
- parenthesis :: Codeable a => a -> Code
- accolades :: Codeable a => a -> Code
- square :: Codeable a => a -> Code
- align :: Codeable a => a -> Code
- codeWidth :: Codeable a => a -> Int
- codeLines :: Codeable a => a -> [Code]
- many :: Codeable a => a -> Code
- mkSequence :: Codeable a => [a] -> Code
- mkStack :: Codeable a => [a] -> Code
- interleave :: (Codeable a, CodeList l) => a -> l -> Code
- (|><|) :: (Codeable a, Codeable b) => a -> b -> Code
- (><) :: (Codeable a, Codeable b) => a -> b -> Code
- (|><) :: (Codeable a, Codeable b) => a -> b -> Code
- (><|) :: (Codeable a, Codeable b) => a -> b -> Code
- (<+>) :: (Codeable a, Codeable b) => a -> b -> Code
- (<++>) :: (Codeable a, Codeable b) => a -> b -> Code
- (<+|) :: (Codeable a, Codeable b) => a -> b -> Code
- (|>+<|) :: (Codeable a, CodeList b) => a -> b -> Code
- (<->) :: (Codeable a, Codeable b) => a -> b -> Code

# Documentation

Representation of code, each string represents a line

Type class for lifting data structures into code

# Functions on code

singleLine :: CodeList a => a -> BoolSource

parenthesis :: Codeable a => a -> CodeSource

mkSequence :: Codeable a => [a] -> CodeSource

interleave :: (Codeable a, CodeList l) => a -> l -> CodeSource

# Combinators for building blocks of code

(|><|) :: (Codeable a, Codeable b) => a -> b -> CodeSource

Join two blocks line by line, in the way of inner join, so both lines have to be present.

(><) :: (Codeable a, Codeable b) => a -> b -> CodeSource

Join two blocks line by line, in the way of outer join, so both missing lines are discarded.

(<+>) :: (Codeable a, Codeable b) => a -> b -> CodeSource

Sequencing. Place the second block after the last line of the first block. Aligns the second block

(<+|) :: (Codeable a, Codeable b) => a -> b -> CodeSource

Place the second block after the last line of the first block. Aligns the second block