elynx-tree-0.1.0: Handle phylogenetic trees

Copyright(c) Dominik Schrempf 2019
LicenseGPL-3
Maintainerdominik.schrempf@gmail.com
Stabilityunstable
Portabilityportable
Safe HaskellNone
LanguageHaskell2010

ELynx.Data.Tree.Subset

Description

Creation date: Fri Dec 13 11:02:43 2019.

Synopsis

Documentation

data Subset a Source #

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 Subsets of leaf nodes are singletons. The Subsets of the root node is the set of all leaves. Subsets are the building blocks of partitions. Each branch on the tree induces a bipartition, or a pair of Subsets, 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 # 
Instance details

Defined in ELynx.Data.Tree.Subset

Methods

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 #

toList :: Subset a -> [a] #

null :: Subset a -> Bool #

length :: Subset a -> Int #

elem :: Eq a => a -> Subset a -> Bool #

maximum :: Ord a => Subset a -> a #

minimum :: Ord a => Subset a -> a #

sum :: Num a => Subset a -> a #

product :: Num a => Subset a -> a #

Eq a => Eq (Subset a) Source # 
Instance details

Defined in ELynx.Data.Tree.Subset

Methods

(==) :: Subset a -> Subset a -> Bool #

(/=) :: Subset a -> Subset a -> Bool #

Ord a => Ord (Subset a) Source # 
Instance details

Defined in ELynx.Data.Tree.Subset

Methods

compare :: Subset a -> Subset a -> Ordering #

(<) :: Subset a -> Subset a -> Bool #

(<=) :: Subset a -> Subset a -> Bool #

(>) :: Subset a -> Subset a -> Bool #

(>=) :: Subset a -> Subset a -> Bool #

max :: Subset a -> Subset a -> Subset a #

min :: Subset a -> Subset a -> Subset a #

(Read a, Ord a) => Read (Subset a) Source # 
Instance details

Defined in ELynx.Data.Tree.Subset

Show a => Show (Subset a) Source # 
Instance details

Defined in ELynx.Data.Tree.Subset

Methods

showsPrec :: Int -> Subset a -> ShowS #

show :: Subset a -> String #

showList :: [Subset a] -> ShowS #

Ord a => Semigroup (Subset a) Source # 
Instance details

Defined in ELynx.Data.Tree.Subset

Methods

(<>) :: Subset a -> Subset a -> Subset a #

sconcat :: NonEmpty (Subset a) -> Subset a #

stimes :: Integral b => b -> Subset a -> Subset a #

Ord a => Monoid (Subset a) Source # 
Instance details

Defined in ELynx.Data.Tree.Subset

Methods

mempty :: Subset a #

mappend :: Subset a -> Subset a -> Subset a #

mconcat :: [Subset a] -> Subset a #

sfromset :: Set a -> Subset a Source #

Create a subset from a set.

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.

snull :: Subset a -> Bool Source #

Is the subset empty?

sempty :: Subset a Source #

The empty subset.

ssingleton :: a -> Subset a Source #

A subset with one element.

sunion :: Ord a => Subset a -> Subset a -> Subset a Source #

Unite two subsets.

sunions :: Ord a => [Subset a] -> Subset a Source #

Unite a list of subsets.

sdifference :: Ord a => Subset a -> Subset a -> Subset a Source #

Difference of two subsets.

sintersection :: Ord a => Subset a -> Subset a -> Subset a Source #

Intersection of two subsets.

sdisjoint :: Ord a => Subset a -> Subset a -> Bool Source #

Are two subsets disjoint?

smember :: Ord a => a -> Subset a -> Bool Source #

Check if an element is member of a subset.

sshow :: (a -> String) -> Subset a -> String Source #

Show the elements of a subset in a human readable way.