yjtools 0.9 → 0.9.5
raw patch · 3 files changed
+22/−7 lines, 3 files
Files
- Data/Bool/Tools.hs +7/−5
- Data/List/Tools.hs +14/−1
- yjtools.cabal +1/−1
Data/Bool/Tools.hs view
@@ -3,8 +3,10 @@ (|||) ) where -import Data.Function.Tools (apply2way)--(&&&), (|||) :: (a -> Bool) -> (a -> Bool) -> a -> Bool-(&&&) = apply2way (&&)-(|||) = apply2way (||)+(&&&), (|||) :: Monad m => m Bool -> m Bool -> m Bool+p1 &&& p2 = do b1 <- p1+ b2 <- p2+ return $ b1 && b2+p1 ||| p2 = do b1 <- p1+ b2 <- p2+ return $ b1 || b2
Data/List/Tools.hs view
@@ -1,7 +1,20 @@ module Data.List.Tools (- mulLists+ takeUntil+, dropUntil+, mulLists , defaultElem ) where++takeUntil :: (a -> Bool) -> [a] -> [a]+dropUntil :: (a -> Bool) -> [a] -> [a]+takeUntil _ [] = []+takeUntil p (x:xs)+ | p x = [x]+ | otherwise = x : takeUntil p xs+dropUntil _ [] = []+dropUntil p (x:xs)+ | p x = xs+ | otherwise = dropUntil p xs mulLists :: [[a]] -> [[a]] mulLists [] = [[]]
yjtools.cabal view
@@ -1,5 +1,5 @@ Name: yjtools-Version: 0.9+Version: 0.9.5 Cabal-Version: >= 1.2 Build-Type: Simple License: LGPL