Safe Haskell | None |
---|
- type :*: a b = (a, b)
- type :+: a b = Either a b
- class Semigroup m where
- (+) :: m -> m -> m
- class (Semigroup a, Semigroup b) => SubSemi a b where
- to :: b -> a
- class Semigroup m => Monoid m where
- zero :: m
- class Monoid m => Ring m where
- class Unit f where
- pure :: a -> f a
- newtype Endo k a = Endo {
- runEndo :: k a a
- newtype Dual m = Dual {
- getDual :: m
- newtype OrdList a = OrdList {
- getOrdList :: [a]
- newtype Interleave a = Interleave {
- interleave :: [a]
- class Category k where
- class Category k => Choice k where
- class Category k => Split k where
- (<#>) :: k a c -> k b d -> k (a, b) (c, d)
- const :: Unit f => a -> f a
- (&) :: b -> (b -> c) -> c
- first :: Split k => k a c -> k (a, d) (c, d)
- second :: Split k => k b d -> k (c, b) (c, d)
- left :: Choice k => k a c -> k (:+: a c) c
- right :: Choice k => k b c -> k (:+: c b) c
- ifThenElse :: Bool -> t -> t -> t
- guard :: (Unit f, Monoid (f ())) => Bool -> f ()
- fail :: [Char] -> a
- module Prelude
Basic union and product types
Basic group and ring structure
Classes
The class of all types that have a binary operation. Note that the operation isn't necesarily commutative (in the case of lists, for example)
Semigroup Bool | |
Semigroup Float | |
Semigroup Int | |
Semigroup Integer | |
Semigroup () | |
Semigroup [a] | |
(Applicative f, Contravariant f, Semigroup m) => Semigroup (f m) | |
Ord a => Semigroup (Set a) | |
Semigroup (Interleave a) | |
Ord a => Semigroup (OrdList a) | |
Semigroup m => Semigroup (Dual m) | |
Semigroup a => Semigroup (Id a) | |
Semigroup a => Semigroup (ZipList a) | |
Category k => Semigroup (Endo k a) | |
SubSemi b a => Semigroup (:+: a b) | |
(Semigroup a, Semigroup b) => Semigroup (:*: a b) | |
Semigroup w => Semigroup (Const w a) | |
Semigroup (f a) => Semigroup (Backwards f a) |
class Semigroup m => Monoid m whereSource
A monoid is a semigroup with a null element such that zero + a == a + zero == a
Monoid Bool | |
Monoid Float | |
Monoid Int | |
Monoid Integer | |
Monoid () | |
Monoid [a] | |
(Applicative f, Contravariant f, Monoid m) => Monoid (f m) | |
Ord a => Monoid (Set a) | |
Monoid (Interleave a) | |
Ord a => Monoid (OrdList a) | |
Monoid m => Monoid (Dual m) | |
Monoid w => Monoid (Id w) | |
Monoid a => Monoid (ZipList a) | |
Category k => Monoid (Endo k a) | |
(SubSemi b a, Monoid a) => Monoid (:+: a b) | |
(Monoid a, Monoid b) => Monoid (:*: a b) | |
Monoid a => Monoid (Const a b) | |
Monoid (f a) => Monoid (Backwards f a) |
Unit [] | |
Unit IO | |
Unit Tree | |
Unit Interleave | |
Unit OrdList | |
Unit Id | |
Unit ZipTree | |
Unit ZipList | |
Unit ((->) b) | |
Unit (Either a) | |
Monoid w => Unit ((,) w) | |
Unit (Const a) | |
Unit f => Unit (Backwards f) | |
(Unit f, Unit g) => Unit (Compose f g) | |
Unit m => Unit (ContT r m) | |
(Monoid w, Monad m) => Unit (WriterT w m) | |
Monad m => Unit (ReaderT r m) | |
Unit m => Unit (StateT s m) | |
Unit m => Unit (Kleisli m a) |
Common monoids
A monoid on category endomorphisms under composition
The dual of a monoid is the same as the original, with arguments reversed
An ordered list
OrdList | |
|
newtype Interleave a Source
Interleave | |
|
Fundamental control operations
Misc functions
ifThenElse :: Bool -> t -> t -> tSource
The rest is imported from the Prelude
module Prelude