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

Safe HaskellSafe-Inferred
LanguageHaskell98

Data.Magma

Synopsis

Documentation

class Magma a where Source

Methods

(<>) :: a -> a -> a Source

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) 

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

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

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

_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)