| Copyright | (c) NoviSci Inc 2020 |
|---|---|
| License | BSD3 |
| Maintainer | bsaul@novisci.com |
| Safe Haskell | Safe |
| Language | Haskell2010 |
FeatureCompose
Contents
Description
Synopsis
- data Show b => FeatureSpec b di d0 = MkFeatureSpec {
- getSpecName :: Text
- getSpecAttr :: b
- getDefn :: FeatureDefinition di d0
- data Show b => Feature b d = MkFeature {
- getName :: Text
- getAttr :: b
- getData :: FeatureData d
- newtype FeatureData d = MkFeatureData {
- getFeatureData :: Either MissingReason [d]
- data MissingReason
- newtype FeatureDefinition di d0 = MkFeatureDefinition (di -> FeatureData d0)
- makeFeatureSpec :: Show b => Text -> b -> FeatureDefinition di d0 -> FeatureSpec b di d0
- featureDataR :: [d] -> FeatureData d
- featureDataL :: MissingReason -> FeatureData d
- define :: (d1 -> d0) -> FeatureDefinition (FeatureData d1) d0
- defineM :: (d1 -> FeatureData d0) -> FeatureDefinition (FeatureData d1) d0
- define2 :: (d2 -> d1 -> d0) -> FeatureDefinition (FeatureData d2, FeatureData d1) d0
- defineM2 :: (d2 -> d1 -> FeatureData d0) -> FeatureDefinition (FeatureData d2, FeatureData d1) d0
- eval :: Eval di d0 => FeatureDefinition di d0 -> di -> FeatureData d0
Types
data Show b => FeatureSpec b di d0 Source #
A FeatureSpec contains all the information needed to derive a Feature:
* its name
* its attributes
* the function needed to derive a feature (i.e. the FeatureDefinition)
Constructors
| MkFeatureSpec | |
Fields
| |
data Show b => Feature b d Source #
A Feature contains the following:
* a name
* its attributes
* FeatureData
newtype FeatureData d Source #
FeatureData is , where Either MissingReason dd can be any type
of data derivable from Events.
Constructors
| MkFeatureData | |
Fields
| |
Instances
data MissingReason Source #
FeatureData may be missing for any number of reasons.
Constructors
| InsufficientData | |
| Excluded | |
| Other Text | |
| Unknown |
Instances
newtype FeatureDefinition di d0 Source #
Constructors
| MkFeatureDefinition (di -> FeatureData d0) |
makeFeatureSpec :: Show b => Text -> b -> FeatureDefinition di d0 -> FeatureSpec b di d0 Source #
TODO
featureDataR :: [d] -> FeatureData d Source #
Create the Right side of FeatureData.
featureDataL :: MissingReason -> FeatureData d Source #
Create the Left side of FeatureData.
define :: (d1 -> d0) -> FeatureDefinition (FeatureData d1) d0 Source #
defineM :: (d1 -> FeatureData d0) -> FeatureDefinition (FeatureData d1) d0 Source #
define2 :: (d2 -> d1 -> d0) -> FeatureDefinition (FeatureData d2, FeatureData d1) d0 Source #
defineM2 :: (d2 -> d1 -> FeatureData d0) -> FeatureDefinition (FeatureData d2, FeatureData d1) d0 Source #
eval :: Eval di d0 => FeatureDefinition di d0 -> di -> FeatureData d0 Source #