pred-trie-0.4.1: Predicative tries

Copyright(c) 2015 Athan Clark
LicenseBSD-3
Maintainerathan.clark@gmail.com
Stabilityexperimental
PortabilityGHC
Safe HaskellNone
LanguageHaskell2010

Data.Trie.Pred.Step

Contents

Description

 

Synopsis

Single Predicated Step

data PredStep c s a Source

Constructors

forall r . PredStep 

Fields

predTag :: !Text

Unique identifier for the predicate - used for combination

predPred :: !(s -> Maybe r)

The predicate, existentially quantified in the successful result r

predData :: !(Maybe (r -> a))

The result function, capturing the quantified result r and turning it into a top-level variable a.

predSub :: !(c s (r -> a))

Any sub-trie must have all results preceeded in arity with the result at this step.

Instances

Trie NonEmpty s c => Trie NonEmpty s (PredStep c) Source

Lookup and delete only - can't arbitrarilly construct a predicated trie.

Functor (c s) => Functor (PredStep c s) Source 
Show s => Show (PredStep c s a) Source 

singletonPred :: Monoid (c s (r -> a)) => Text -> (s -> Maybe r) -> (r -> a) -> PredStep c s a Source

Adjacent Predicated Steps

newtype PredSteps c s a Source

Adjacent steps

Constructors

PredSteps 

Fields

unPredSteps :: [PredStep c s a]
 

Instances

Trie NonEmpty s c => Trie NonEmpty s (PredSteps c) Source

Lookup and delete only - can't arbitrarilly construct a predicated trie.

Functor (c s) => Functor (PredSteps c s) Source 
Show s => Show (PredSteps c s a) Source 
Eq s => Monoid (PredSteps c s a) Source 

unionPred :: PredSteps c s a -> PredSteps c s a -> PredSteps c s a Source

Last-style instance