| Copyright | (c) NoviSci Inc 2020 |
|---|---|
| License | BSD3 |
| Maintainer | bsaul@novisci.com |
| Safe Haskell | Safe |
| Language | Haskell2010 |
Hasklepias.Types.Feature
Contents
Description
Synopsis
- data Show b => FeatureSpec b k d = FeatureSpec {
- getSpecName :: Text
- getSpecAttr :: b
- getDefn :: FeatureDefinition k d
- data Show b => Feature b d = Feature {
- getName :: Text
- getAttr :: b
- getData :: FeatureData d
- newtype FeatureData d = FeatureData {}
- data MissingReason
- newtype FeatureDefinition input d = MkFeatureDef (input -> FeatureData d)
- class Defineable input where
- define :: (input -> FeatureData d) -> FeatureDefinition input d
- eval :: FeatureDefinition input d -> input -> FeatureData d
- maybeFeature :: MissingReason -> (a -> Maybe c) -> (c -> d) -> a -> FeatureData d
- featureDataR :: d -> FeatureData d
- featureDataL :: MissingReason -> FeatureData d
Types
data Show b => FeatureSpec b k d 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
| FeatureSpec | |
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
| FeatureData | |
Fields | |
Instances
data MissingReason Source #
A Feature may be missing for any number of reasons.
Constructors
| InsufficientData | |
| Excluded | |
| Other Text | |
| Unknown |
Instances
newtype FeatureDefinition input d Source #
A type to hold FeatureData definitions; i.e. functions that return features.
Constructors
| MkFeatureDef (input -> FeatureData d) |
class Defineable input where Source #
Minimal complete definition
Nothing
Methods
define :: (input -> FeatureData d) -> FeatureDefinition input d Source #
eval :: FeatureDefinition input d -> input -> FeatureData d Source #
Instances
maybeFeature :: MissingReason -> (a -> Maybe c) -> (c -> d) -> a -> FeatureData d Source #
featureDataR :: d -> FeatureData d Source #
Create the Right side of FeatureData.
featureDataL :: MissingReason -> FeatureData d Source #
Create the Left side of FeatureData.