Skip to content

Commit

Permalink
Update io-sim/src/Data/List/Trace.hs
Browse files Browse the repository at this point in the history
Co-authored-by: Marcin Szamotulski <coot@coot.me>
  • Loading branch information
bolt12 and coot committed May 8, 2024
1 parent 68f6770 commit c75ca9a
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions io-sim/src/Data/List/Trace.hs
Original file line number Diff line number Diff line change
Expand Up @@ -78,10 +78,10 @@ take n (Cons b o) = Cons b (take (n - 1) o)

-- | Take elements from the Trace while the predicate holds, converting each to ().
takeWhile :: (b -> Bool) -> Trace a b -> Trace (Maybe a) b
takeWhile _ (Nil a) = Nil (Just a)
takeWhile _ (Nil a) = Nil (Just a)
takeWhile p (Cons b o)
| p b = Cons b (takeWhile p o)
| otherwise = Nil Nothing
| p b = Cons b (takeWhile p o)
| otherwise = Nil Nothing

-- | Drop the first n elements of a Trace.
drop :: Int -> Trace a b -> Trace a b
Expand Down

0 comments on commit c75ca9a

Please sign in to comment.