| Copyright | (c) Andrew Ray, 2017 |
|---|---|
| License | MIT |
| Safe Haskell | Safe |
Util
Description
Utility functions for Yasgheld.
- strip :: String -> String
- replace :: Eq a => [a] -> [a] -> [a] -> [a]
- removeComment :: String -> String
- (??) :: Eq a => [(a, b, c)] -> a -> Maybe b
- (?) :: Eq a => [(a, b, c)] -> a -> Maybe (b, c)
Documentation
Arguments
| :: String | Input String |
| -> String | Output String, whitespace removed |
Strips leading and trailing whitespace from the given String.
Arguments
| :: Eq a | |
| => [a] | The search value |
| -> [a] | The replace value |
| -> [a] | The string to search in |
| -> [a] | The string, after substitutions |
Performs substitution on a string
Arguments
| :: String | String to remove comments from |
| -> String | String with comments removed |
Removes comments from strings
(??) infixl 9
Arguments
| :: Eq a | |
| => [(a, b, c)] | The list of three-tuples to search in |
| -> a | The first term to search for |
| -> Maybe b | Just the second term, or Nothing if no matches |
Finds the second term referenced by the first given term
(?) infixl 9
Arguments
| :: Eq a | |
| => [(a, b, c)] | The list of three-tuples to search in |
| -> a | The first term to search for |
| -> Maybe (b, c) | Just the last two terms, or Nothing if no matches |
Finds the list referenced by the given first term