String and other utilities
- dropSpace :: [Char] -> [Char]
- dropSpaceEnd :: [Char] -> [Char]
- dropNL :: [Char] -> [Char]
- splitFirstWord :: String -> (String, String)
- limitStr :: Int -> String -> String
- listToStr :: String -> [String] -> String
- showClean :: Show a => [a] -> String
- expandTab :: Int -> String -> String
- arePrefixesWithSpaceOf :: [String] -> String -> Bool
- arePrefixesOf :: [String] -> String -> Bool
- io :: MonadIO m => IO a -> m a
- random :: MonadIO m => [a] -> m a
- insult :: [String]
- confirmation :: [String]
dropSpace takes as input a String and strips spaces from the
prefix as well as the suffix of the String. Example:
dropSpace " abc " ===> "abc"
Break a String into it's first word, and the rest of the string. Example:
split_first_word "A fine day" ===> ("A", "fine day)
Truncate a string to the specified length, putting ellipses at the end if necessary.
Form a list of terms using a single conjunction. Example:
listToStr "and" ["a", "b", "c"] ===> "a, b and c"
show a list without heavyweight formatting
NB: assumes show instance outputs a quoted
under that assumption, strips the outer quotes.