magma-0.2.2.0: magma is an algebraic structure consisting a set together with an binary operation.

Data.Magma

Synopsis

# Documentation

class Magma a whereSource

Methods

(<>) :: a -> a -> aSource

Instances

 Magma All Magma Any Magma a => Magma (Dual a) Magma (Endo a) Num a => Magma (Sum a) Num a => Magma (Product a) Magma (First a) Magma (Last a) Ord a => Magma (Min a) Ord a => Magma (Max a) Monoid m => Magma (WrappedMonoid m) Magma (BinaryTree a)

data BinaryTree a Source

Constructors

 Leaf a Node (BinaryTree a) (BinaryTree a)

Instances

 Monad BinaryTree Functor BinaryTree Applicative BinaryTree Foldable BinaryTree Traversable BinaryTree Eq a => Eq (BinaryTree a) Ord a => Ord (BinaryTree a) Read a => Read (BinaryTree a) Show a => Show (BinaryTree a) NFData a => NFData (BinaryTree a) Magma (BinaryTree a)

cataBinaryTree :: (a -> r) -> (r -> r -> r) -> BinaryTree a -> rSource

anaBinaryTree :: (b -> Either a (b, b)) -> b -> BinaryTree aSource

foldMap :: Magma m => (a -> m) -> BinaryTree a -> mSource

_Leaf :: forall p f a. (Choice p, Applicative f) => p a (f a) -> p (BinaryTree a) (f (BinaryTree a))Source

``_Leaf` :: Prism' (`BinaryTree` a) a`

_Node :: forall p f a. (Choice p, Applicative f) => p (BinaryTree a, BinaryTree a) (f (BinaryTree a, BinaryTree a)) -> p (BinaryTree a) (f (BinaryTree a))Source

``_Node` :: Prism' (`BinaryTree` a) (`BinaryTree` a, `BinaryTree` a)`

nodeLeft :: Applicative f => (BinaryTree a -> f (BinaryTree a)) -> BinaryTree a -> f (BinaryTree a)Source

``nodeLeft` :: Traversal' (`BinaryTree` a) (`BinaryTree` a)`

nodeRight :: Applicative f => (BinaryTree a -> f (BinaryTree a)) -> BinaryTree a -> f (BinaryTree a)Source

``nodeRight` :: Traversal' (`BinaryTree` a) (`BinaryTree` a)`