Safe Haskell | Safe-Infered |
---|

- envIsSet :: String -> Bool
- getEnvMaybe :: String -> Maybe String
- subsetOf :: Ord a => [a] -> [a] -> Bool
- noDuplicates :: Ord a => [a] -> Bool
- equivClasses :: (Ord a, Ord b) => [(a, b)] -> Map b (Set a)
- whileTrue :: Monad m => m Bool -> m Int
- stringSHA256 :: String -> String
- setAny :: (a -> Bool) -> Set a -> Bool
- invertMap :: (Ord k, Ord v) => Map k v -> Map v k

# Environment

envIsSet :: String -> BoolSource

`envIsSet k`

returns `True`

if there is a v such `k=v`

is in the environment and `False`

otherwise.

getEnvMaybe :: String -> Maybe StringSource

`getEnvMaybe k`

returns `Just v`

if `k=v`

is in the environment and `Nothing`

otherwise

# List operations

subsetOf :: Ord a => [a] -> [a] -> BoolSource

`subsetOf xs ys`

return `True`

if `set xs`

is a subset of `set ys`

noDuplicates :: Ord a => [a] -> BoolSource

`noDuplicates xs`

returns `True`

if the list `xs`

contains no duplicates

equivClasses :: (Ord a, Ord b) => [(a, b)] -> Map b (Set a)Source

Compute the equality classes given wrto a partial function.

# Control

whileTrue :: Monad m => m Bool -> m IntSource

`whileTrue m`

iterates m until it returns `False`

.
Returns the number of iterations `m`

was run. `0`

means `m`

never returned `True`

.

# Hashing

stringSHA256 :: String -> StringSource

The SHA-256 hash of a string in base64 notation.