clash-lib-1.2.0: CAES Language for Synchronous Hardware - As a Library

Safe HaskellSafe
LanguageHaskell2010

Data.List.Extra

Synopsis

Documentation

partitionM :: Monad m => (a -> m Bool) -> [a] -> m ([a], [a]) Source #

Monadic version of partition

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

Monadic version of mapAccumL

(<:>) :: Applicative f => f a -> f [a] -> f [a] infixr 5 Source #

Applicative version of 'GHC.Types.(:)'

indexMaybe :: [a] -> Int -> Maybe a Source #

Safe indexing, returns a Nothing if the index does not exist

splitAtList :: [b] -> [a] -> ([a], [a]) Source #

equalLength :: [a] -> [b] -> Bool Source #

countEq Source #

Arguments

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

Haystack

-> Int

Times needle was found in haystack

Return number of occurrences of an item in a list

zipEqual :: [a] -> [b] -> [(a, b)] Source #

Zip two lists of equal length

NB Errors out for a 1 compiler when the two lists are not of equal length

anyM :: Monad m => (a -> m Bool) -> [a] -> m Bool Source #

Short-circuiting monadic version of any

allM :: Monad m => (a -> m Bool) -> [a] -> m Bool Source #

orM :: Monad m => [m Bool] -> m Bool Source #

short-circuiting monadic version of or