| Copyright | (c) NoviSci Inc 2020 |
|---|---|
| License | BSD3 |
| Maintainer | bsaul@novisci.com |
| Safe Haskell | Safe |
| Language | Haskell2010 |
Hasklepias.Types.Context
Description
Synopsis
- data Context
- context :: Concepts -> Context
- emptyContext :: Context
- data Concept
- data Concepts
- toConcepts :: Set Concept -> Concepts
- fromConcepts :: Concepts -> Set Concept
- packConcept :: Text -> Concept
- unpackConcept :: Concept -> Text
- packConcepts :: [Text] -> Concepts
- unpackConcepts :: Concepts -> [Text]
- class HasConcept a where
- hasConcept :: a -> Text -> Bool
- hasConcepts :: a -> [Text] -> Bool
- hasAllConcepts :: a -> [Text] -> Bool
Documentation
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 Hasklepias.Types.Context | |
| Arbitrary (Interval a) => Arbitrary (Event a) Source # | |
| FromJSON (Event Int) Source # | |
| FromJSON (Event Day) Source # | |
| HasConcept (Event a) Source # | |
Defined in Hasklepias.Types.Event | |
emptyContext :: Context Source #
Just an empty Context
A Concept is textual "tag" for a context.
Instances
| Eq Concepts Source # | |
| Show Concepts Source # | |
| Semigroup Concepts Source # | |
| Monoid Concepts Source # | |
| FromJSON Concepts Source # | |
| HasConcept Concepts Source # | |
Defined in Hasklepias.Types.Context | |
| (Ord a, Show a, Arbitrary (Interval a)) => Arbitrary (ConceptEvent a) Source # | |
Defined in Hasklepias.Types.Event.Arbitrary | |
| HasConcept (ConceptEvent a) Source # | |
Defined in Hasklepias.Types.Event Methods hasConcept :: ConceptEvent a -> Text -> Bool Source # hasConcepts :: ConceptEvent a -> [Text] -> Bool Source # hasAllConcepts :: ConceptEvent a -> [Text] -> Bool Source # | |
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
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 Hasklepias.Types.Context | |
| HasConcept Context Source # | |
Defined in Hasklepias.Types.Context | |
| HasConcept (ConceptEvent a) Source # | |
Defined in Hasklepias.Types.Event Methods hasConcept :: ConceptEvent a -> Text -> Bool Source # hasConcepts :: ConceptEvent a -> [Text] -> Bool Source # hasAllConcepts :: ConceptEvent a -> [Text] -> Bool Source # | |
| HasConcept (Event a) Source # | |
Defined in Hasklepias.Types.Event | |