Copyright | (c) Dominik Schrempf 2019 |
---|---|
License | GPL-3 |
Maintainer | dominik.schrempf@gmail.com |
Stability | unstable |
Portability | portable |
Safe Haskell | None |
Language | Haskell2010 |
Creation date: Fri Dec 13 11:02:43 2019.
Synopsis
- data Subset a
- sfromset :: Set a -> Subset a
- sfromlist :: Ord a => [a] -> Subset a
- smap :: Ord b => (a -> b) -> Subset a -> Subset b
- snull :: Subset a -> Bool
- sempty :: Subset a
- ssingleton :: a -> Subset a
- sunion :: Ord a => Subset a -> Subset a -> Subset a
- sunions :: Ord a => [Subset a] -> Subset a
- sdifference :: Ord a => Subset a -> Subset a -> Subset a
- sintersection :: Ord a => Subset a -> Subset a -> Subset a
- sdisjoint :: Ord a => Subset a -> Subset a -> Bool
- smember :: Ord a => a -> Subset a -> Bool
- sshow :: (a -> String) -> Subset a -> String
Documentation
A Subset
is a set of elements of type a. For example, on phylogenetic
trees, a Subset
is a set of leaves. In this case, a Subset
is induced,
for example, by a node on the (rooted) tree. The Subset
s of leaf nodes are
singletons. The Subset
s of the root node is the set of all leaves.
Subset
s are the building blocks of partitions. Each branch on the tree
induces a bipartition, or a pair of Subset
s, see
Bipartition
. Multifurcations induce multipartitions, see
Multipartition
.
Internally, a subset is just an Set
, since the order of elements
within the subset is not important, but the uniqueness of elements is.
Instances
Foldable Subset Source # | |
Defined in ELynx.Data.Tree.Subset fold :: Monoid m => Subset m -> m # foldMap :: Monoid m => (a -> m) -> Subset a -> m # foldr :: (a -> b -> b) -> b -> Subset a -> b # foldr' :: (a -> b -> b) -> b -> Subset a -> b # foldl :: (b -> a -> b) -> b -> Subset a -> b # foldl' :: (b -> a -> b) -> b -> Subset a -> b # foldr1 :: (a -> a -> a) -> Subset a -> a # foldl1 :: (a -> a -> a) -> Subset a -> a # elem :: Eq a => a -> Subset a -> Bool # maximum :: Ord a => Subset a -> a # minimum :: Ord a => Subset a -> a # | |
Eq a => Eq (Subset a) Source # | |
Ord a => Ord (Subset a) Source # | |
Defined in ELynx.Data.Tree.Subset | |
(Read a, Ord a) => Read (Subset a) Source # | |
Show a => Show (Subset a) Source # | |
Ord a => Semigroup (Subset a) Source # | |
Ord a => Monoid (Subset a) Source # | |
sfromlist :: Ord a => [a] -> Subset a Source #
Create a subset from a list. Throws an error if duplicate elements are present in the list.
smap :: Ord b => (a -> b) -> Subset a -> Subset b Source #
Map a function over all elements in a subset.
ssingleton :: a -> Subset a Source #
A subset with one element.