Split Dodge.Base
This commit is contained in:
@@ -6,6 +6,7 @@ module FoldableHelp
|
||||
, safeMinimumOnMaybeL
|
||||
, safeMinMaybeL
|
||||
, filter3
|
||||
, takeUntil
|
||||
, module Data.Foldable
|
||||
)
|
||||
where
|
||||
@@ -82,3 +83,9 @@ filter3 t1 t2 t3 = L.fold $ (,,)
|
||||
-- go x (y:xs) | f x < f y = go x xs
|
||||
-- | otherwise = go y xs
|
||||
-- go x [] = x
|
||||
|
||||
{- | Implementation copied from
|
||||
- https://hackage.haskell.org/package/utility-ht-0.0.16/docs/src/Data.List.HT.Private.html#takeUntil
|
||||
-}
|
||||
takeUntil :: Foldable t => (a -> Bool) -> t a -> [a]
|
||||
takeUntil p = foldr (\x xs -> x : if p x then [] else xs) []
|
||||
|
||||
Reference in New Issue
Block a user