|
| Moltap.Util.Util | | Portability | portable | | Stability | experimental | | Maintainer | twanvl@gmail.com |
|
|
|
|
|
| Description |
| Utility functions used throughout Moltap
|
|
| Synopsis |
|
|
|
|
| Sorted lists
|
|
| iud :: Ord a => [a] -> [a] -> ([a], [a], [a], [a]) |
Intersection, union and differences of sorted lists
iud a b = (intersection, union, only in a, only in b)
|
|
| Relations
|
|
| type Relation a = Map a [a] |
| A binary relation from a to a
|
|
| symmClose :: Ord a => Relation a -> Relation a |
| Symmetric closure of a relation
|
|
| reflClose :: Ord a => [a] -> Relation a -> Relation a |
| Reflexive closure of a relation
|
|
| transClose :: Ord a => Bool -> [a] -> Relation a -> Relation a |
| (Reflexive-)transitive closure of a relation
|
|
| transCloseAt :: Ord a => Bool -> a -> Relation a -> Set a |
| A single element from the (reflexive-)transitive closure
|
|
| ShowS
|
|
| catShows :: [ShowS] -> ShowS |
| Concatenate a list of ShowSs
|
|
| showListWith :: (a -> ShowS) -> [a] -> ShowS |
| Show a list by applying a function to each element
|
|
| showListWithSep :: String -> (a -> ShowS) -> [a] -> ShowS |
| Show a list by applying a function to each element, and putting a separator between them
|
|
| Strings
|
|
| escapeString :: String -> String |
| Escape a string for dot or json output
|
|
| Files
|
|
| toFileName :: String -> FilePath |
| Turn a string into something that is safe to use as a filename.
The string will uniquely determine the filename.
|
|
| makeFileReadable :: FilePath -> IO () |
| Make a file readable to all users
|
|
| IO Monad
|
|
| errorIO :: MonadIO m => String -> m a |
| error in the IO monad
|
|
| parIO :: IO a -> IO a -> IO a |
| Perform two actions in parallel, use the result from the one that finishes first.
stolen from
http://www.haskell.org/pipermail/haskell-cafe/2005-January/008314.html
|
|
| timeout :: Int -> IO a -> IO (Maybe a) |
| Run an action with a timeout (in microseconds)
|
|
| timeoutWith :: Int -> IO a -> IO a -> IO a |
| Run an action with a timeout (in microseconds)
|
|
| Produced by Haddock version 0.8 |