hdirect-0.21.0: An IDL compiler for Haskell

Utils

Synopsis

Documentation

mapFromMb :: b -> (a -> b) -> Maybe a -> bSource

mapMb :: (a -> b) -> Maybe a -> Maybe bSource

mapMbM :: Monad m => (a -> m b) -> Maybe a -> m (Maybe b)Source

toMaybe :: (a -> Bool) -> a -> Maybe aSource

split :: Eq a => a -> [a] -> [[a]]Source

splitLast :: Eq a => [a] -> [a] -> ([a], [a])Source

splitLastBy :: ([a] -> Bool) -> ([a] -> [a]) -> [a] -> ([a], [a])Source

prefix :: Eq a => [a] -> [a] -> Maybe [a]Source

traceIf :: Bool -> String -> a -> aSource

elemBy :: (a -> Bool) -> [a] -> BoolSource

mapUnzip :: (a -> (b, c)) -> [a] -> ([b], [c])Source

diff :: Num a => [a] -> [a]Source

(#) :: a -> (a -> b) -> bSource

trace :: String -> a -> a

When called, trace outputs the string in its first argument, before returning the second argument as its result. The trace function is not referentially transparent, and should only be used for debugging, or for monitoring execution. Some implementations of trace may decorate the string that's output to indicate that you're tracing. The function is implemented on top of putTraceMsg.

bailIf :: Bool -> a -> a -> aSource

decons :: [a] -> ([a], a)Source

safe_init :: [a] -> [a]Source

snoc :: [a] -> a -> [a]Source

mapAccumLM :: Monad m => (acc -> x -> m (acc, y)) -> acc -> [x] -> m (acc, [y])Source