| Copyright | (c) NoviSci Inc 2020 |
|---|---|
| License | BSD3 |
| Maintainer | bsaul@novisci.com |
| Safe Haskell | None |
| Language | Haskell2010 |
EventData
Contents
Description
Synopsis
- type Event a = PairedInterval Context a
- type Events a = [Event a]
- type ConceptEvent a = PairedInterval Concepts a
- event :: Interval a -> Context -> Event a
- ctxt :: Event a -> Context
- toConceptEvent :: (Show a, Ord a) => Event a -> ConceptEvent a
- toConceptEventOf :: (Show a, Ord a) => [Concept] -> Event a -> ConceptEvent a
- mkConceptEvent :: (Show a, Ord a) => Interval a -> Concepts -> ConceptEvent a
- class HasConcept a where
- hasConcept :: a -> Text -> Bool
- hasConcepts :: a -> [Text] -> Bool
- hasAllConcepts :: a -> [Text] -> Bool
- data Concepts
- data Concept
- data Context = Context {}
- packConcept :: Text -> Concept
- toConcepts :: Set Concept -> Concepts
- fromConcepts :: Concepts -> Set Concept
Documentation
type Event a = PairedInterval Context a Source #
An Event a is simply a pair (Interval a, Context).
type Events a = [Event a] Source #
A List of Event a
NOTE (20190911): I (B. Saul) am starting out the Events type as a list of the Event type. This may be not be the optimal approach, especially with regards to lookup/filtering the list. Ideally, we could do one pass through the ordered container (whatever it is) to identify events by concept; rather than repeated evaluations of the lookup predicates. This could be handled by, for example, representing Events has a Map with a list of concept indices. But this gets us off the ground.
type ConceptEvent a = PairedInterval Concepts a Source #
An event containing only concepts and an interval
toConceptEvent :: (Show a, Ord a) => Event a -> ConceptEvent a Source #
Drops an Event to a ConceptEvent by moving the concepts in the data
position in the paired interval and throwing out the facts and source.
toConceptEventOf :: (Show a, Ord a) => [Concept] -> Event a -> ConceptEvent a Source #
mkConceptEvent :: (Show a, Ord a) => Interval a -> Concepts -> ConceptEvent a Source #
class HasConcept a where Source #
The HasConcept typeclass provides predicate functions for determining whether
an a has a concept.
Minimal complete definition
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?
Instances
| HasConcept Concepts Source # | |
Defined in EventData.Context | |
| HasConcept Context Source # | |
Defined in EventData.Context | |
| HasConcept (ConceptEvent a) Source # | |
Defined in EventData Methods hasConcept :: ConceptEvent a -> Text -> Bool Source # hasConcepts :: ConceptEvent a -> [Text] -> Bool Source # hasAllConcepts :: ConceptEvent a -> [Text] -> Bool Source # | |
| HasConcept (Event a) Source # | |
Instances
| Eq Concepts Source # | |
| Show Concepts Source # | |
| Semigroup Concepts Source # | |
| Monoid Concepts Source # | |
| FromJSON Concepts Source # | |
| HasConcept Concepts Source # | |
Defined in EventData.Context | |
| (Ord a, Show a, Arbitrary (Interval a)) => Arbitrary (ConceptEvent a) Source # | |
Defined in EventData.Arbitrary | |
| HasConcept (ConceptEvent a) Source # | |
Defined in EventData Methods hasConcept :: ConceptEvent a -> Text -> Bool Source # hasConcepts :: ConceptEvent a -> [Text] -> Bool Source # hasAllConcepts :: ConceptEvent a -> [Text] -> Bool Source # | |
A Concept is textual "tag" for a context.
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
| Eq Context Source # | |
| Show Context Source # | |
| Semigroup Context Source # | |
| Monoid Context Source # | |
| Arbitrary Context Source # | |
| FromJSON Context Source # | |
| HasConcept Context Source # | |
Defined in EventData.Context | |
| Arbitrary (Interval a) => Arbitrary (Event a) Source # | |
| (FromJSON a, Show a, IntervalSizeable a b) => FromJSON (Event a) Source # | |
| HasConcept (Event a) Source # | |
packConcept :: Text -> Concept Source #
Pack text into a concept
Orphan instances
| HasConcept (ConceptEvent a) Source # | |
Methods hasConcept :: ConceptEvent a -> Text -> Bool Source # hasConcepts :: ConceptEvent a -> [Text] -> Bool Source # hasAllConcepts :: ConceptEvent a -> [Text] -> Bool Source # | |
| HasConcept (Event a) Source # | |