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

FeatureCompose

Contents

Description

 
Synopsis

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 

data Show b => Feature b d Source #

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

Constructors

MkFeature 

Fields

Instances

Instances details
Show b => Functor (Feature b) Source # 
Instance details

Defined in FeatureCompose

Methods

fmap :: (a -> b0) -> Feature b a -> Feature b b0 #

(<$) :: a -> Feature b b0 -> Feature b a #

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

Defined in FeatureCompose

Methods

(==) :: Feature b d -> Feature b d -> Bool #

(/=) :: Feature b d -> Feature b d -> Bool #

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

Defined in FeatureCompose

Methods

showsPrec :: Int -> Feature b d -> ShowS #

show :: Feature b d -> String #

showList :: [Feature b d] -> ShowS #

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

Defined in FeatureCompose.Aeson

newtype FeatureData d Source #

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

Constructors

MkFeatureData 

Instances

Instances details
Monad FeatureData Source # 
Instance details

Defined in FeatureCompose

Methods

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

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

return :: a -> FeatureData a #

Functor FeatureData Source # 
Instance details

Defined in FeatureCompose

Methods

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

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

Applicative FeatureData Source # 
Instance details

Defined in FeatureCompose

Methods

pure :: a -> FeatureData a #

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

liftA2 :: (a -> b -> c) -> FeatureData a -> FeatureData b -> FeatureData c #

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

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

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

Defined in FeatureCompose

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

Defined in FeatureCompose

Generic (FeatureData d) Source # 
Instance details

Defined in FeatureCompose

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 FeatureCompose.Aeson

type Rep (FeatureData d) Source # 
Instance details

Defined in FeatureCompose

type Rep (FeatureData d) = D1 ('MetaData "FeatureData" "FeatureCompose" "hasklepias-0.8.3-4JckWWC7OnJ2c8iMNmwmkn" 'True) (C1 ('MetaCons "MkFeatureData" 'PrefixI 'True) (S1 ('MetaSel ('Just "getFeatureData") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Either MissingReason [d]))))

data MissingReason Source #

FeatureData may be missing for any number of reasons.

Instances

Instances details
Eq MissingReason Source # 
Instance details

Defined in FeatureCompose

Read MissingReason Source # 
Instance details

Defined in FeatureCompose

Show MissingReason Source # 
Instance details

Defined in FeatureCompose

Generic MissingReason Source # 
Instance details

Defined in FeatureCompose

Associated Types

type Rep MissingReason :: Type -> Type #

ToJSON MissingReason Source # 
Instance details

Defined in FeatureCompose.Aeson

type Rep MissingReason Source # 
Instance details

Defined in FeatureCompose

type Rep MissingReason = D1 ('MetaData "MissingReason" "FeatureCompose" "hasklepias-0.8.3-4JckWWC7OnJ2c8iMNmwmkn" '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 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.

define :: (d1 -> d0) -> FeatureDefinition (FeatureData d1) d0 Source #

define2 :: (d2 -> d1 -> d0) -> FeatureDefinition (FeatureData d2, FeatureData d1) d0 Source #

eval :: Eval di d0 => FeatureDefinition di d0 -> di -> FeatureData d0 Source #