packages feed

timestamp 0.1.1 → 0.2

raw patch · 3 files changed

+32/−32 lines, 3 filesdep ~base

Dependency ranges changed: base

Files

− library/Timestamp/Foldls.hs
@@ -1,30 +0,0 @@-{-|-Folds on timestamped values--}-module Timestamp.Foldl-where--import Timestamp.Prelude hiding (maximum)-import Timestamp-import Control.Foldl---untimestamped :: Fold input output -> Fold (Timestamped input) output-untimestamped =-  premap (\ (Timestamped _ x) -> x)--filteringByUtcTime :: (UTCTime -> Bool) -> Fold (Timestamped input) output -> Fold (Timestamped input) output-filteringByUtcTime filter =-  filteringByTimestamp (filter . timestampUtcTime)--filteringByTimestamp :: (Timestamp -> Bool) -> Fold (Timestamped input) output -> Fold (Timestamped input) output-filteringByTimestamp filter =-  prefilter (\ (Timestamped ts _) -> filter ts)--inUtcTimeRange :: UTCTime -> UTCTime -> Fold (Timestamped input) output -> Fold (Timestamped input) output-inUtcTimeRange start end =-  inTimestampRange (utcTimeTimestamp start) (utcTimeTimestamp end)--inTimestampRange :: Timestamp -> Timestamp -> Fold (Timestamped input) output -> Fold (Timestamped input) output-inTimestampRange start end =-  filteringByTimestamp (\ ts -> ts >= start && ts < end)
+ library/Timestamp/Folds.hs view
@@ -0,0 +1,30 @@+{-|+Folds on timestamped values+-}+module Timestamp.Folds+where++import Timestamp.Prelude hiding (maximum)+import Timestamp+import Control.Foldl+++untimestamped :: Fold input output -> Fold (Timestamped input) output+untimestamped =+  premap (\ (Timestamped _ x) -> x)++filteringByUtcTime :: (UTCTime -> Bool) -> Fold (Timestamped input) output -> Fold (Timestamped input) output+filteringByUtcTime filter =+  filteringByTimestamp (filter . timestampUtcTime)++filteringByTimestamp :: (Timestamp -> Bool) -> Fold (Timestamped input) output -> Fold (Timestamped input) output+filteringByTimestamp filter =+  prefilter (\ (Timestamped ts _) -> filter ts)++inUtcTimeRange :: UTCTime -> UTCTime -> Fold (Timestamped input) output -> Fold (Timestamped input) output+inUtcTimeRange start end =+  inTimestampRange (utcTimeTimestamp start) (utcTimeTimestamp end)++inTimestampRange :: Timestamp -> Timestamp -> Fold (Timestamped input) output -> Fold (Timestamped input) output+inTimestampRange start end =+  filteringByTimestamp (\ ts -> ts >= start && ts < end)
timestamp.cabal view
@@ -1,7 +1,7 @@ name:   timestamp version:-  0.1.1+  0.2 synopsis:   Space-efficient Unix timestamp and utilities category:@@ -40,7 +40,7 @@     Haskell2010   exposed-modules:     Timestamp-    Timestamp.Foldls+    Timestamp.Folds   other-modules:     Timestamp.Data.Conversion     Timestamp.Data.TypesAndInstances