Safe Haskell | Safe-Infered |
---|
Remark: the heavy use of strictness here is for correctly catching exceptions, not for performance reasons
- module Data.Tree
- module Data.Monoid
- data StrictList a
- class ToStrictList x a where
- strictList :: x -> StrictList a
- fromStrictList :: StrictList a -> [a]
- data StrictTree a
- type StrictForest a = StrictList (StrictTree a)
- class ToStrictTree x a where
- strictTree :: x -> StrictTree a
- class ToStrictForest y a where
- strictForest :: y -> StrictForest a
- modifyValue :: StrictTree a -> (a -> a) -> StrictTree a
- modifyChildren :: StrictTree a -> (StrictForest a -> StrictForest a) -> StrictTree a
- nodeValue :: StrictTree a -> a
- nodeChildren :: StrictTree t -> [StrictTree t]
- fromStrictTree :: StrictTree a -> Tree a
- fromStrictForest :: StrictForest a -> Forest a
Documentation
module Data.Tree
module Data.Monoid
Strict lists
data StrictList a Source
Strict lists (in both the head and tail)
Note: Most operations for this type are provided via the ListLike
instance, but ListLike
is not reexported here.
Functor StrictList | |
Typeable1 StrictList | |
Foldable StrictList | |
Traversable StrictList | |
Data a => Data (StrictList a) | |
Show a => Show (StrictList a) | |
Monoid (StrictList a) | Empty list and appending |
ListLike (StrictList a) a | |
FoldableLL (StrictList a) a | |
ToStrictForest (StrictForest a) a | Identity |
ToStrictTree x a => ToStrictForest (StrictList x) a | |
ToStrictList (StrictList a) a | Identity |
Construction
class ToStrictList x a whereSource
strictList :: x -> StrictList aSource
ToStrictList a a | Singleton |
ToStrictList [a] a | From lazy list |
ToStrictList (StrictList a) a | Identity |
ToStrictList x a => ToStrictList (a, x) a | Cons |
Destruction
fromStrictList :: StrictList a -> [a]Source
Strict trees and forests
data StrictTree a Source
Functor StrictTree | |
Typeable1 StrictTree | |
Foldable StrictTree | |
Traversable StrictTree | |
Data a => Data (StrictTree a) | |
Show a => Show (StrictTree a) | |
ToStrictForest (StrictForest a) a | Identity |
ToStrictTree (StrictTree a) a | Identity |
type StrictForest a = StrictList (StrictTree a)Source
Construction
class ToStrictTree x a whereSource
strictTree :: x -> StrictTree aSource
ToStrictTree a a | Leaf |
ToStrictTree (Tree a) a | From lazy tree |
ToStrictTree (StrictTree a) a | Identity |
ToStrictForest y a => ToStrictTree (a, y) a | From node value and subforest |
class ToStrictForest y a whereSource
strictForest :: y -> StrictForest aSource
ToStrictTree x a => ToStrictForest [x] a | |
ToStrictForest (StrictForest a) a | Identity |
ToStrictTree x a => ToStrictForest (StrictList x) a |
Modification
modifyValue :: StrictTree a -> (a -> a) -> StrictTree aSource
Note: this function is not recursive.
modifyChildren :: StrictTree a -> (StrictForest a -> StrictForest a) -> StrictTree aSource
Note: this function is not recursive.
Destruction
nodeValue :: StrictTree a -> aSource
nodeChildren :: StrictTree t -> [StrictTree t]Source
fromStrictTree :: StrictTree a -> Tree aSource
fromStrictForest :: StrictForest a -> Forest aSource