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

Hasklepias.Functions

Description

Provides functions used in defining Features.

Synopsis

Container predicates

isNotEmpty :: [a] -> Bool Source #

Is the input list empty?

atleastNofX Source #

Arguments

:: Int

n

-> [Text]

x

-> Events a 
-> Bool 

Does Events have at least n events with any of the Concept in x.

twoXOrOneY :: [Text] -> [Text] -> Events a -> Bool Source #

TODO

Finding occurrences of concepts

nthConceptOccurrence Source #

Arguments

:: (Events a -> Maybe (Event a))

function used to select a single event

-> [Text] 
-> Events a 
-> Maybe (Event a) 

Filter Events to a single Maybe Event, based on a provided function, with the provided concepts. For example, see firstConceptOccurrence and lastConceptOccurrence.

firstConceptOccurrence :: [Text] -> Events a -> Maybe (Event a) Source #

Finds the *first* occurrence of an Event with at least one of the concepts. Assumes the input Events list is appropriately sorted.

Reshaping containers

allPairs :: [a] -> [b] -> [(a, b)] Source #

Generate all pair-wise combinations from two lists.

splitByConcepts :: [Text] -> [Text] -> Events a -> (Events a, Events a) Source #

Split an Events a into a pair of Events a. The first element contains events have any of the concepts in the first argument, similarly for the second element.

Create filters

makeConceptsFilter Source #

Arguments

:: [Text]

the list of concepts by which to filter

-> Events a 
-> Events a 

Filter Events to those that have any of the provided concepts.

makePairedFilter :: Ord a => ComparativePredicateOf2 (i0 a) (PairedInterval b a) -> i0 a -> (b -> Bool) -> [PairedInterval b a] -> [PairedInterval b a] Source #