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

Hasklepias.Types.Context

Description

 
Synopsis

Documentation

data Context Source #

A Context consists of three parts: concepts, facts, and source.

At this time, facts and source are simply stubs to be fleshed out in later versions of hasklepias.

Instances

Instances details
Eq Context Source # 
Instance details

Defined in Hasklepias.Types.Context

Methods

(==) :: Context -> Context -> Bool #

(/=) :: Context -> Context -> Bool #

Show Context Source # 
Instance details

Defined in Hasklepias.Types.Context

Semigroup Context Source # 
Instance details

Defined in Hasklepias.Types.Context

Monoid Context Source # 
Instance details

Defined in Hasklepias.Types.Context

Arbitrary Context Source # 
Instance details

Defined in Hasklepias.Types.Context.Arbitrary

FromJSON Context Source # 
Instance details

Defined in Hasklepias.Types.Event.Aeson

HasConcept Context Source # 
Instance details

Defined in Hasklepias.Types.Context

Arbitrary (Interval a) => Arbitrary (Event a) Source # 
Instance details

Defined in Hasklepias.Types.Event.Arbitrary

Methods

arbitrary :: Gen (Event a) #

shrink :: Event a -> [Event a] #

FromJSON (Event Int) Source # 
Instance details

Defined in Hasklepias.Types.Event.Aeson

FromJSON (Event Day) Source # 
Instance details

Defined in Hasklepias.Types.Event.Aeson

HasConcept (Event a) Source # 
Instance details

Defined in Hasklepias.Types.Event

context :: Concepts -> Context Source #

Smart contructor for Context type

Creates Context from a list of Concepts. At this time, the facts and source are both set to Nothing.

emptyContext :: Context Source #

Just an empty Context

data Concept Source #

A Concept is textual "tag" for a context.

Instances

Instances details
Eq Concept Source # 
Instance details

Defined in Hasklepias.Types.Context

Methods

(==) :: Concept -> Concept -> Bool #

(/=) :: Concept -> Concept -> Bool #

Ord Concept Source # 
Instance details

Defined in Hasklepias.Types.Context

Show Concept Source # 
Instance details

Defined in Hasklepias.Types.Context

Arbitrary Concept Source # 
Instance details

Defined in Hasklepias.Types.Context.Arbitrary

FromJSON Concept Source # 
Instance details

Defined in Hasklepias.Types.Event.Aeson

data Concepts Source #

Concepts is a Set of Conceptss.

Instances

Instances details
Eq Concepts Source # 
Instance details

Defined in Hasklepias.Types.Context

Show Concepts Source # 
Instance details

Defined in Hasklepias.Types.Context

Semigroup Concepts Source # 
Instance details

Defined in Hasklepias.Types.Context

Monoid Concepts Source # 
Instance details

Defined in Hasklepias.Types.Context

FromJSON Concepts Source # 
Instance details

Defined in Hasklepias.Types.Event.Aeson

HasConcept Concepts Source # 
Instance details

Defined in Hasklepias.Types.Context

(Ord a, Show a, Arbitrary (Interval a)) => Arbitrary (ConceptEvent a) Source # 
Instance details

Defined in Hasklepias.Types.Event.Arbitrary

HasConcept (ConceptEvent a) Source # 
Instance details

Defined in Hasklepias.Types.Event

packConcept :: Text -> Concept Source #

Pack text into a concept

unpackConcept :: Concept -> Text Source #

Unpack text from a concept

packConcepts :: [Text] -> Concepts Source #

Put a list of text into a set concepts.

unpackConcepts :: Concepts -> [Text] Source #

Take a set of concepts to a list of text.

class HasConcept a where Source #

The HasConcept typeclass provides predicate functions for determining whether an a has a concept.

Minimal complete definition

hasConcept

Methods

hasConcept :: a -> Text -> Bool Source #

Does an a have a particular Concept?

hasConcepts :: a -> [Text] -> Bool Source #

Does an a have *any* of a list of Concepts?

hasAllConcepts :: a -> [Text] -> Bool Source #

Does an a have *all* of a list of Concepts?