packages feed

hasklepias 0.4.2 → 0.4.3

raw patch · 5 files changed

+29/−8 lines, 5 filesdep ~timePVP: major bump suggested

API removals or changes: PVP suggests a major version bump

Dependency ranges changed: time

API changes (from Hackage documentation)

- Hasklepias.Types.Feature: data Feature d
- Hasklepias.Types.Feature: getFeature :: Feature d -> Either MissingReason d
+ Hasklepias.Reexports: const :: a -> b -> a
+ Hasklepias.Types.Feature: Feature :: Either MissingReason d -> Feature d
+ Hasklepias.Types.Feature: [getFeature] :: Feature d -> Either MissingReason d
+ Hasklepias.Types.Feature: defineFEF2 :: Intervallic Interval a => MissingReason -> (e -> Events a -> Feature d) -> FeatureDefinition e a d
+ Hasklepias.Types.Feature: newtype Feature d
- Hasklepias.Functions: allPairs :: [a] -> [a] -> [(a, a)]
+ Hasklepias.Functions: allPairs :: [a] -> [b] -> [(a, b)]

Files

ChangeLog.md view
@@ -1,5 +1,12 @@ # Changelog for hasklepias +## 0.4.3++* Exports `Feature` constructor.+* Adds `defineFEF2` function for creating a feature definition where the provided function returns a `Feature d` rather than just a `d`.+* Generalizes `allPairs` from type `[a] -> [a] -> [(a, a)]` to `[a] -> [b] -> [(a, b)]`.+* Reexports a few functions and types from `Data.Time.Calendar`. Also reexports `const` from `Data.Function`.+ ## 0.4.2  * Updates `interval-algebra` to 0.8.0
hasklepias.cabal view
@@ -1,6 +1,6 @@ cabal-version:  2.2 name:           hasklepias-version:        0.4.2+version:        0.4.3 description:    Please see the README on GitHub at <https://github.com/novisci/asclepias#readme> homepage:       https://github.com/novisci/asclepias/#readme bug-reports:    https://github.com/novisci/asclepias/issues@@ -47,7 +47,7 @@     , flow == 1.0.22     , interval-algebra == 0.8.0     , text >=1.2.3-    , time >=1.9+    , time >=1.11     , unordered-containers >=0.2.10     , safe >= 0.3     , vector >=0.12@@ -79,7 +79,7 @@     , hspec     , interval-algebra == 0.8.0     , text >=1.2.3-    , time >=1.9+    , time >=1.11     , unordered-containers >=0.2.10     , vector >=0.12     , QuickCheck@@ -104,7 +104,7 @@     , text >=1.2.3     , bytestring >=0.10     , containers >=0.6.0-    , time >=1.9+    , time >=1.11     , aeson >=1.4.0.0 && <2     , unordered-containers >=0.2.10     , vector >=0.12
src/Hasklepias/Functions.hs view
@@ -129,7 +129,7 @@ makePairedFilter fi i fc = filter (makePairPredicate fi i fc)  -- | Generate all pair-wise combinations from two lists.-allPairs :: [a] -> [a] -> [(a, a)]+allPairs :: [a] -> [b] -> [(a, b)] allPairs = liftA2 (,)  -- | Split an @Events a@ into a pair of @Events a@. The first element contains
src/Hasklepias/Reexports.hs view
@@ -33,7 +33,7 @@                                             , (&&), not, (||)                                             , bool                                             , otherwise )-import safe Data.Function                   ( (.), ($) )+import safe Data.Function                   ( (.), ($), const ) import safe Data.Functor                    ( fmap ) import safe Data.Int                        ( Int ) import safe Data.List                       ( all, map, filter, length, null )@@ -49,6 +49,7 @@                                               maybeToList ) import safe Data.Ord                        ( Ord((>=), (<), (>), (<=))                                             , max, min )+import safe Data.Time.Calendar              ( Day, fromGregorian, MonthOfYear, Year ) import safe Data.Text                       ( pack, Text ) import safe Data.Tuple                      ( fst, snd, uncurry, curry ) import safe Flow                            ( (!>), (.>), (<!), (<.), (<|), (|>) )
src/Hasklepias/Types/Feature.hs view
@@ -15,13 +15,13 @@  module Hasklepias.Types.Feature(     -- * Types-      Feature-    , getFeature+      Feature(..)     , MissingReason(..)     , FeatureDefinition(..)     , applyEF     , defineEF     , defineFEF+    , defineFEF2     , applyFEF     , featureR     , featureL@@ -106,6 +106,19 @@   case feat of     (Left _)  -> featureL r     (Right x) -> featureR (g x es)+  )++defineFEF2 :: (Intervallic Interval a) =>+             MissingReason+          -- ^ The reason if the input 'Feature' is a 'Left'.+          -> (e -> Events a -> Feature d)+          -- ^ A function that tranforms the data of a 'Right' input 'Feature'+          --   and a collection of events into the desired type.+          -> FeatureDefinition e a d+defineFEF2 r g = FEF (\(Feature feat) es ->+  case feat of+    (Left _)  -> featureL r+    (Right x) -> g x es   )  -- | Extract a 'FEF' FeatureDefinition