Skip to content

Commit

Permalink
Fix getCustomerDeposits in case of no interval
Browse files Browse the repository at this point in the history
  • Loading branch information
paolino committed Nov 6, 2024
1 parent 692be30 commit 1316be9
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,9 @@ fmapTimedSeq f = TimedSeq . fmap' (fmap f) . unTimedSeq
singleton :: Monoid a => Timed t a -> TimedSeq t a
singleton = TimedSeq . FingerTree.singleton

instance Monoid a => Measured (Timed t a) (TimedSeq t a) where
measure = measure . unTimedSeq

instance Foldable (TimedSeq t) where
foldMap f = foldMap (f . monoid) . unTimedSeq

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,9 @@ import Data.Bifunctor
import Data.Digest.CRC32
( crc32
)
import Data.FingerTree
( Measured (..)
)
import Data.Foldable
( fold
, foldl'
Expand Down Expand Up @@ -394,7 +397,7 @@ wonders interval =
=> Maybe (WithOrigin UTCTime, WithOrigin UTCTime)
-> TimedSeq (DownTime) a
-> Timed (DownTime) a
extractInterval' Nothing = mempty
extractInterval' Nothing = measure
extractInterval' (Just (t1, t2)) = extractInterval (Down t1) (Down t2)

{-----------------------------------------------------------------------------
Expand Down

0 comments on commit 1316be9

Please sign in to comment.