| Safe Haskell | Safe-Inferred |
|---|---|
| Language | Haskell2010 |
Utils.Drasil
Description
Re-exports all utilities.
Synopsis
- blank :: Doc
- indent :: Doc -> Doc
- indentList :: [Doc] -> Doc
- contSep :: Separator
- filterEmpty :: [Doc] -> [Doc]
- listToDoc :: [String] -> Doc
- type Separator = Doc
- capitalize :: String -> String
- stringList :: [String] -> String
- replaceAll :: Eq a => [a] -> a -> [a] -> [a]
- subsetOf :: Eq a => [a] -> [a] -> Bool
- nubSort :: Ord a => [a] -> [a]
- weave :: [a] -> [a] -> [a]
- foldle :: (a -> a -> a) -> (a -> a -> a) -> a -> [a] -> a
- foldle1 :: (a -> a -> a) -> (a -> a -> a) -> [a] -> a
- toColumn :: [a] -> [[a]]
- mkTable :: [a -> b] -> [a] -> [[b]]
- toPlainName :: String -> String
- repUnd :: String -> String
Documentation
indentList :: [Doc] -> Doc Source #
Indents a list of Docs and combines into one Doc.
capitalize :: String -> String Source #
String capitalization.
stringList :: [String] -> String Source #
Comma separated list with "and" before final item.
replaceAll :: Eq a => [a] -> a -> [a] -> [a] Source #
Replaces all elements of a target list that belong to a provided "bad" input list.
weave :: [a] -> [a] -> [a] Source #
Interweaves two lists together [[a,b,c],[d,e,f]] -> [a,d,b,e,c,f].
foldle :: (a -> a -> a) -> (a -> a -> a) -> a -> [a] -> a Source #
Fold that applies f to all but the last element and g to the last
element and the accumulator given an initial value, z.
foldle1 :: (a -> a -> a) -> (a -> a -> a) -> [a] -> a Source #
Fold that applies f to all but last element and g to the last element
and accumulator, without a starting value. Does not work on empty lists.
mkTable :: [a -> b] -> [a] -> [[b]] Source #
Create a table body (not including header row) by applying the given functions to the column elements of the table rows (in order). The first argument is a list of functions to be applied (one per column). This essentially creates the rows. The second argument is a list of elements apply the functions to.
For example, mkTable [id, *5] [1,2,3] should produce a table:
| 1 | 5 | | 2 | 10 | | 3 | 15 |
toPlainName :: String -> String Source #
Replace occurences of special characters (",~`-=!#$%^&*+[]\;'/|"<>? ")
with underscores ("_"@).
TODO: This can probably become a bit more comprehensive, anything other than a-z, A-Z, or 0-9 could probably be replaced.