apart-0.1.3: Get all your structure and rip it apart.

Safe HaskellSafe
LanguageHaskell2010

Data.Apart.Structures.Tree.Prefix

Synopsis

Documentation

type Prefix s t = Cofree (Labeled s t) Source #

data Labeled s t a Source #

Constructors

Hop s (t a) 
Instances
Functor t => Functor (Labeled s t) Source # 
Instance details

Defined in Data.Apart.Structures.Tree.Prefix

Methods

fmap :: (a -> b) -> Labeled s t a -> Labeled s t b #

(<$) :: a -> Labeled s t b -> Labeled s t a #

Foldable t => Foldable (Labeled s t) Source # 
Instance details

Defined in Data.Apart.Structures.Tree.Prefix

Methods

fold :: Monoid m => Labeled s t m -> m #

foldMap :: Monoid m => (a -> m) -> Labeled s t a -> m #

foldr :: (a -> b -> b) -> b -> Labeled s t a -> b #

foldr' :: (a -> b -> b) -> b -> Labeled s t a -> b #

foldl :: (b -> a -> b) -> b -> Labeled s t a -> b #

foldl' :: (b -> a -> b) -> b -> Labeled s t a -> b #

foldr1 :: (a -> a -> a) -> Labeled s t a -> a #

foldl1 :: (a -> a -> a) -> Labeled s t a -> a #

toList :: Labeled s t a -> [a] #

null :: Labeled s t a -> Bool #

length :: Labeled s t a -> Int #

elem :: Eq a => a -> Labeled s t a -> Bool #

maximum :: Ord a => Labeled s t a -> a #

minimum :: Ord a => Labeled s t a -> a #

sum :: Num a => Labeled s t a -> a #

product :: Num a => Labeled s t a -> a #

Traversable t => Traversable (Labeled s t) Source # 
Instance details

Defined in Data.Apart.Structures.Tree.Prefix

Methods

traverse :: Applicative f => (a -> f b) -> Labeled s t a -> f (Labeled s t b) #

sequenceA :: Applicative f => Labeled s t (f a) -> f (Labeled s t a) #

mapM :: Monad m => (a -> m b) -> Labeled s t a -> m (Labeled s t b) #

sequence :: Monad m => Labeled s t (m a) -> m (Labeled s t a) #

(Show s, Show (t a)) => Show (Labeled s t a) Source # 
Instance details

Defined in Data.Apart.Structures.Tree.Prefix

Methods

showsPrec :: Int -> Labeled s t a -> ShowS #

show :: Labeled s t a -> String #

showList :: [Labeled s t a] -> ShowS #

singleton :: Alternative t => s -> a -> Prefix s t a Source #

seek :: (Functor t, Foldable t, Eq s) => Stack s -> Prefix s t v -> Maybe v Source #

insert :: (Foldable t, Alternative t, Eq s) => Stack s -> v -> Prefix s t v -> Prefix s t v Source #

You can insert value with path + 1 symbol of existing path in tree.

crumbs :: (Foldable t, Alternative t, Eq s, Monoid v) => Stack s -> v -> Prefix s t v -> Prefix s t v Source #

Unlike insert, you can specify longest path, but a gap will be filled Monoid's empty values