From 59fd5217099e12513d1f61066829e6fd4a62670e Mon Sep 17 00:00:00 2001 From: Rob Rix Date: Sun, 6 Aug 2017 09:42:10 -0400 Subject: [PATCH] Add callstacks to while & until. --- src/Data/Syntax/Assignment.hs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Data/Syntax/Assignment.hs b/src/Data/Syntax/Assignment.hs index f6ef23351..07adb5b3f 100644 --- a/src/Data/Syntax/Assignment.hs +++ b/src/Data/Syntax/Assignment.hs @@ -163,14 +163,14 @@ children forEach = withFrozenCallStack $ Children forEach `Then` return -- | Collect a list of values passing a predicate. -while :: (Alternative m, Monad m) => (a -> Bool) -> m a -> m [a] +while :: (Alternative m, Monad m, HasCallStack) => (a -> Bool) -> m a -> m [a] while predicate step = many $ do result <- step guard (predicate result) pure result -- | Collect a list of values failing a predicate. -until :: (Alternative m, Monad m) => (a -> Bool) -> m a -> m [a] +until :: (Alternative m, Monad m, HasCallStack) => (a -> Bool) -> m a -> m [a] until = while . (not .)