Copyright | (c) 2014 2015 Athan Clark |
---|---|
License | BSD-style |
Maintainer | athan.clark@gmail.com |
Stability | experimental |
Portability | GHC |
Safe Haskell | None |
Language | Haskell2010 |
An implementation of left-child, right-sibling binary trees.
Synopsis
- newtype KnuthTree a = KnuthTree {
- unKnuthTree :: (a, KnuthForest a)
- firstTree :: KnuthForest a -> Maybe (KnuthTree a)
- size :: KnuthTree a -> Int
- elem :: Eq a => a -> KnuthTree a -> Bool
- elemPath :: Eq a => [a] -> KnuthTree a -> Bool
- isSubtreeOf :: Eq a => KnuthTree a -> KnuthTree a -> Bool
- isSubtreeOf' :: Eq a => KnuthTree a -> KnuthTree a -> Bool
- isProperSubtreeOf :: Eq a => KnuthTree a -> KnuthTree a -> Bool
- isProperSubtreeOf' :: Eq a => KnuthTree a -> KnuthTree a -> Bool
- isChildOf :: Eq a => a -> KnuthTree a -> Bool
- isDescendantOf :: Eq a => a -> KnuthTree a -> Bool
- isProperDescendantOf :: Eq a => a -> KnuthTree a -> Bool
- singleton :: a -> KnuthTree a
- delete :: Eq a => a -> KnuthTree a -> Maybe (KnuthTree a)
- union :: KnuthTree a -> KnuthTree a -> KnuthTree a
- intersection :: Eq a => KnuthTree a -> KnuthTree a -> Maybe (KnuthTree a)
- difference :: Eq a => KnuthTree a -> KnuthTree a -> Maybe (KnuthTree a)
- toTree :: KnuthTree a -> Tree a
- fromTree :: Tree a -> KnuthTree a
Documentation
KnuthTree | |
|
Instances
Monad KnuthTree Source # | |
Functor KnuthTree Source # | |
Applicative KnuthTree Source # | |
Foldable KnuthTree Source # | |
Defined in Data.Tree.Knuth fold :: Monoid m => KnuthTree m -> m # foldMap :: Monoid m => (a -> m) -> KnuthTree a -> m # foldr :: (a -> b -> b) -> b -> KnuthTree a -> b # foldr' :: (a -> b -> b) -> b -> KnuthTree a -> b # foldl :: (b -> a -> b) -> b -> KnuthTree a -> b # foldl' :: (b -> a -> b) -> b -> KnuthTree a -> b # foldr1 :: (a -> a -> a) -> KnuthTree a -> a # foldl1 :: (a -> a -> a) -> KnuthTree a -> a # toList :: KnuthTree a -> [a] # length :: KnuthTree a -> Int # elem :: Eq a => a -> KnuthTree a -> Bool # maximum :: Ord a => KnuthTree a -> a # minimum :: Ord a => KnuthTree a -> a # | |
Traversable KnuthTree Source # | |
RoseTree KnuthTree Source # | |
HasSingleton a (KnuthTree a) Source # | |
Defined in Data.Tree.Knuth | |
Eq a => Eq (KnuthTree a) Source # | |
Data a => Data (KnuthTree a) Source # | |
Defined in Data.Tree.Knuth gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> KnuthTree a -> c (KnuthTree a) # gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c (KnuthTree a) # toConstr :: KnuthTree a -> Constr # dataTypeOf :: KnuthTree a -> DataType # dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c (KnuthTree a)) # dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c (KnuthTree a)) # gmapT :: (forall b. Data b => b -> b) -> KnuthTree a -> KnuthTree a # gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> KnuthTree a -> r # gmapQr :: (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> KnuthTree a -> r # gmapQ :: (forall d. Data d => d -> u) -> KnuthTree a -> [u] # gmapQi :: Int -> (forall d. Data d => d -> u) -> KnuthTree a -> u # gmapM :: Monad m => (forall d. Data d => d -> m d) -> KnuthTree a -> m (KnuthTree a) # gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> KnuthTree a -> m (KnuthTree a) # gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> KnuthTree a -> m (KnuthTree a) # | |
Show a => Show (KnuthTree a) Source # | |
Generic (KnuthTree a) Source # | |
Semigroup (KnuthTree a) Source # | |
Arbitrary a => Arbitrary (KnuthTree a) Source # | |
NFData a => NFData (KnuthTree a) Source # | |
Defined in Data.Tree.Knuth | |
HasUnion (KnuthTree a) Source # | |
HasSize (KnuthTree a) Source # | |
Defined in Data.Tree.Knuth | |
type Rep (KnuthTree a) Source # | |
Defined in Data.Tree.Knuth type Rep (KnuthTree a) = D1 (MetaData "KnuthTree" "Data.Tree.Knuth" "rose-trees-0.0.4.5-A00tWdqblf7Al7c9J60KpO" True) (C1 (MetaCons "KnuthTree" PrefixI True) (S1 (MetaSel (Just "unKnuthTree") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 (a, KnuthForest a)))) | |
type Tail (KnuthTree a) Source # | |
Defined in Data.Tree.Rose | |
type Head (KnuthTree a) Source # | |
Defined in Data.Tree.Rose |