From 58b2c2c4a8e6c5bc1782ac748ef207264418ac8d Mon Sep 17 00:00:00 2001 From: Jan Tuomi Date: Fri, 28 Jan 2022 19:25:47 +0200 Subject: Add conditionals, rework interpret order --- src/utils.hs | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'src/utils.hs') diff --git a/src/utils.hs b/src/utils.hs index 9ba2fa0..e3c0150 100644 --- a/src/utils.hs +++ b/src/utils.hs @@ -1,4 +1,5 @@ module Utils where +import qualified Data.Bifunctor as B (.>) = flip (.) @@ -28,3 +29,6 @@ isIntStr str = in case ir of Just _ -> True Nothing -> False + +breakOn :: (a -> Bool) -> [a] -> ([a], [a]) +breakOn cond xs = break cond xs $> B.second (drop 1) -- cgit v1.3