Copyright | (c) Microsoft |
---|---|
License | MIT |
Maintainer | adamsap@microsoft.com |
Stability | provisional |
Portability | portable |
Safe Haskell | None |
Language | Haskell98 |
Helper functions for creating common text structures useful in code generation.
These functions operate on Text
objects.
- commonHeader :: ToText a => a -> a -> Text
- newlineSep :: Int64 -> (a -> Text) -> [a] -> Text
- commaLineSep :: Int64 -> (a -> Text) -> [a] -> Text
- newlineSepEnd :: Int64 -> (a -> Text) -> [a] -> Text
- newlineBeginSep :: Int64 -> (a -> Text) -> [a] -> Text
- doubleLineSep :: Int64 -> (a -> Text) -> [a] -> Text
- doubleLineSepEnd :: Int64 -> (a -> Text) -> [a] -> Text
Documentation
commonHeader :: ToText a => a -> a -> Text Source #
Returns common header for generated files using specified single-line comment lead character(s) and a file name.
newlineSep :: Int64 -> (a -> Text) -> [a] -> Text Source #
Separates elements of a list with new lines. Starts new lines at the specified indentation level.
commaLineSep :: Int64 -> (a -> Text) -> [a] -> Text Source #
Separates elements of a list with comma followed by a new line. Starts new lines at the specified indentation level.
newlineSepEnd :: Int64 -> (a -> Text) -> [a] -> Text Source #
Separates elements of a list with new lines, ending with a new line. Starts new lines at the specified indentation level.
newlineBeginSep :: Int64 -> (a -> Text) -> [a] -> Text Source #
Separates elements of a list with new lines, beginning with a new line. Starts new lines at the specified indentation level.
doubleLineSep :: Int64 -> (a -> Text) -> [a] -> Text Source #
Separates elements of a list with two new lines. Starts new lines at the specified indentation level.
doubleLineSepEnd :: Int64 -> (a -> Text) -> [a] -> Text Source #
Separates elements of a list with two new lines, ending with two new lines. Starts new lines at the specified indentation level.