[Haskell-cafe] where to put general-purpose utility functions
travitch at cs.wisc.edu
Sat Jan 21 21:46:54 CET 2012
You might find many of these on hackage in various forms already.. it
might be easier to just depend on some of those libraries.
On Sat, Jan 21, 2012 at 04:20:25PM -0400, Joey Hess wrote:
> Some quite generic monadic control functions, few of them truely unique:
> whenM :: Monad m => m Bool -> m () -> m () -- also >>?
> unlessM :: Monad m => m Bool -> m () -> m () -- also >>!
> firstM :: Monad m => (a -> m Bool) -> [a] -> m (Maybe a)
has a few of these.
> Various path manipulation functions such as:
> absPath :: FilePath -> IO FilePath
Is this different from canonicalizePath in directory?
> Other stuff:
> separate :: (a -> Bool) -> [a] -> ([a], [a])
Is this partition from Data.List?
> format :: Format -> Variables -> String
This looks like it might be similar to HStringTemplate
> withTempFile :: Template -> (FilePath -> Handle -> IO a) -> IO a
has a few variants of this one
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Size: 189 bytes
Desc: not available
More information about the Haskell-Cafe