pred-trie-0.5.1.2: 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

Typeable 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.

Methods

lookup :: NonEmpty s -> PredStep k c s a -> Maybe a

insert :: NonEmpty s -> a -> PredStep k c s a -> PredStep k c s a

delete :: NonEmpty s -> PredStep k c s a -> PredStep k c s a

Functor (c s) => Functor (PredStep k c s) Source # 

Methods

fmap :: (a -> b) -> PredStep k c s a -> PredStep k c s b #

(<$) :: a -> PredStep k c s b -> PredStep k c s a #

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

Methods

showsPrec :: Int -> PredStep k c s a -> ShowS #

show :: PredStep k c s a -> String #

showList :: [PredStep k c s a] -> ShowS #

singletonPred :: (Monoid (c s (r -> a)), Typeable r) => 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

Instances

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

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

Methods

lookup :: NonEmpty s -> PredSteps k c s a -> Maybe a

insert :: NonEmpty s -> a -> PredSteps k c s a -> PredSteps k c s a

delete :: NonEmpty s -> PredSteps k c s a -> PredSteps k c s a

Functor (c s) => Functor (PredSteps k c s) Source # 

Methods

fmap :: (a -> b) -> PredSteps k c s a -> PredSteps k c s b #

(<$) :: a -> PredSteps k c s b -> PredSteps k c s a #

(Show k, Show s) => Show (PredSteps k c s a) Source # 

Methods

showsPrec :: Int -> PredSteps k c s a -> ShowS #

show :: PredSteps k c s a -> String #

showList :: [PredSteps k c s a] -> ShowS #

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

Methods

mempty :: PredSteps k c s a #

mappend :: PredSteps k c s a -> PredSteps k c s a -> PredSteps k c s a #

mconcat :: [PredSteps k c s a] -> PredSteps k c s a #

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

Last-style instance