hasklepias-0.6.0: Define features from events
Copyright(c) NoviSci Inc 2020
LicenseBSD3
Maintainerbsaul@novisci.com
Safe HaskellSafe
LanguageHaskell2010

Hasklepias.Types.Feature

Contents

Description

 
Synopsis

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 

data Show b => Feature b d Source #

A Feature contains the following: * a name * its attributes * FeatureData

Constructors

Feature 

Fields

Instances

Instances details
(Show b, ToJSON b, ToJSON d) => ToJSON (Feature b d) Source # 
Instance details

Defined in Hasklepias.Types.Feature.Aeson

newtype FeatureData d Source #

FeatureData is Either MissingReason d, where d can be any type of data derivable from Events.

Instances

Instances details
Functor FeatureData Source # 
Instance details

Defined in Hasklepias.Types.Feature

Methods

fmap :: (a -> b) -> FeatureData a -> FeatureData b #

(<$) :: a -> FeatureData b -> FeatureData a #

Eq d => Eq (FeatureData d) Source # 
Instance details

Defined in Hasklepias.Types.Feature

Show d => Show (FeatureData d) Source # 
Instance details

Defined in Hasklepias.Types.Feature

Generic (FeatureData d) Source # 
Instance details

Defined in Hasklepias.Types.Feature

Associated Types

type Rep (FeatureData d) :: Type -> Type #

Methods

from :: FeatureData d -> Rep (FeatureData d) x #

to :: Rep (FeatureData d) x -> FeatureData d #

ToJSON d => ToJSON (FeatureData d) Source # 
Instance details

Defined in Hasklepias.Types.Feature.Aeson

Defineable (FeatureData e, FeatureData f) Source # 
Instance details

Defined in Hasklepias.Types.Feature

Defineable (FeatureData e, Events a) Source # 
Instance details

Defined in Hasklepias.Types.Feature

Defineable (FeatureData e, FeatureData f, FeatureData g) Source # 
Instance details

Defined in Hasklepias.Types.Feature

type Rep (FeatureData d) Source # 
Instance details

Defined in Hasklepias.Types.Feature

type Rep (FeatureData d) = D1 ('MetaData "FeatureData" "Hasklepias.Types.Feature" "hasklepias-0.6.0-inplace" 'True) (C1 ('MetaCons "FeatureData" 'PrefixI 'True) (S1 ('MetaSel ('Just "getFeatureData") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Either MissingReason d))))

data MissingReason Source #

A Feature may be missing for any number of reasons.

Instances

Instances details
Eq MissingReason Source # 
Instance details

Defined in Hasklepias.Types.Feature

Read MissingReason Source # 
Instance details

Defined in Hasklepias.Types.Feature

Show MissingReason Source # 
Instance details

Defined in Hasklepias.Types.Feature

Generic MissingReason Source # 
Instance details

Defined in Hasklepias.Types.Feature

Associated Types

type Rep MissingReason :: Type -> Type #

ToJSON MissingReason Source # 
Instance details

Defined in Hasklepias.Types.Feature.Aeson

type Rep MissingReason Source # 
Instance details

Defined in Hasklepias.Types.Feature

type Rep MissingReason = D1 ('MetaData "MissingReason" "Hasklepias.Types.Feature" "hasklepias-0.6.0-inplace" 'False) ((C1 ('MetaCons "InsufficientData" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "Excluded" 'PrefixI 'False) (U1 :: Type -> Type)) :+: (C1 ('MetaCons "Other" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Text)) :+: C1 ('MetaCons "Unknown" 'PrefixI 'False) (U1 :: Type -> Type)))

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 #

maybeFeature :: MissingReason -> (a -> Maybe c) -> (c -> d) -> a -> FeatureData d Source #

featureDataR :: d -> FeatureData d Source #

Create the Right side of FeatureData.