X-Git-Url: https://git.stderr.nl/gitweb?p=matthijs%2Fmaster-project%2Fc%CE%BBash.git;a=blobdiff_plain;f=c%CE%BBash%2FCLasH%2FUtils.hs;h=2966757a038b1d2fefd6a9db51547a0bcf8d0bff;hp=41d7beee98a635083b2ad0c66d7aedbfc9403c46;hb=31aaefbc8c86e9fff93fa4fbeaec3302c4679282;hpb=20e2625d1199e3642b73188471e9804efa1ab763 diff --git "a/c\316\273ash/CLasH/Utils.hs" "b/c\316\273ash/CLasH/Utils.hs" index 41d7bee..2966757 100644 --- "a/c\316\273ash/CLasH/Utils.hs" +++ "b/c\316\273ash/CLasH/Utils.hs" @@ -48,6 +48,12 @@ andM, orM :: (Monad m) => m [Bool] -> m Bool andM = Monad.liftM and orM = Monad.liftM or +-- | Monadic versions of any and all. We reimplement them, since there +-- is no ready-made lifting function for them. +allM, anyM :: (Monad m) => (a -> m Bool) -> [a] -> m Bool +allM f = andM . (mapM f) +anyM f = orM . (mapM f) + mapAccumLM :: (Monad m) => (acc -> x -> m (acc, y)) -> acc -> [x] -> m (acc, [y]) mapAccumLM _ s [] = return (s, []) mapAccumLM f s (x:xs) = do