Skip to content

Commit

Permalink
Inline lastS
Browse files Browse the repository at this point in the history
  • Loading branch information
Manuel Bärenz authored and turion committed Nov 29, 2024
1 parent 11fabe5 commit 19b1a23
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions automaton/src/Data/Automaton.hs
Original file line number Diff line number Diff line change
Expand Up @@ -535,3 +535,4 @@ count = feedback 0 $! arr (\(_, n) -> let n' = n + 1 in (n', n'))
-- | Remembers the last 'Just' value, defaulting to the given initialisation value.
lastS :: (Monad m) => a -> Automaton m (Maybe a) a
lastS a = arr Last >>> mappendS >>> arr (getLast >>> fromMaybe a)
{-# INLINE lastS #-}

0 comments on commit 19b1a23

Please sign in to comment.