modulo-1.7.2: Modular C code generator

PortabilityGHC
Stabilityexperimental
Maintainerhans@hanshoglund.se
Safe HaskellNone

Language.Modulo.Util

Contents

Description

 

Synopsis

String and Char stuff

toUpperString :: String -> StringSource

Synonym for 'fmap Char.toUpper'

toLowerString :: String -> StringSource

Synonym for 'fmap Char.toLower'

toCapitalString :: String -> StringSource

Convert a string to use upper case for the leading letter and lower case for remaining letters.

List stuff

withPrefix :: [a] -> [a] -> [a]Source

Synonym for '(++)'

withSuffix :: [a] -> [a] -> [a]Source

Synonym for 'flip (++)'

sep :: a -> [a] -> [a]Source

Separate a list by the given element.

Equivalent to intersperse

pre :: a -> [a] -> [a]Source

Initiate and separate a list by the given element.

post :: a -> [a] -> [a]Source

Separate and terminate a list by the given element.

wrap :: a -> a -> [a] -> [a]Source

Separate and terminate a list by the given element.

concatSep :: [a] -> [[a]] -> [a]Source

Combination of concat and sep.

concatPre :: [a] -> [[a]] -> [a]Source

Combination of concat and pre.

concatPost :: [a] -> [[a]] -> [a]Source

Combination of concat and post.

concatWrap :: [a] -> [a] -> [[a]] -> [a]Source

Combination of concat and wrap.

divideList :: Int -> [a] -> [[a]]Source

Divide a list into parts of maximum length n.

breakList :: Int -> [a] -> [a] -> [a]Source

Break up a list into parts of maximum length n, inserting the given list as separator. Useful for breaking up strings, as in breakList 80 n str.

Monad stuff

concatMapM :: (Monad f, Functor f) => (a -> f [b]) -> [a] -> f [b]Source

Break up a list into parts of maximum length n, inserting the given list as separator. Useful for breaking up strings, as in breakList 80 n str.