pred-trie-0.5.0: Predicative tries

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

Data.Trie.Pred.Base.Step

Contents

Description

 

Synopsis

Single Predicated Step

data PredStep k c s a Source

Constructors

forall r . PredStep 

Fields

predTag :: !k

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 k c) Source

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

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

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

Adjacent Predicated Steps

newtype PredSteps k c s a Source

Adjacent steps

Constructors

PredSteps 

Fields

unPredSteps :: [PredStep k c s a]
 

Instances

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

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

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

unionPred :: Eq k => PredSteps k c s a -> PredSteps k c s a -> PredSteps k c s a Source

Last-style instance