Clean-0.4: A light, clean and powerful utility library

Safe HaskellNone

Clean.Core

Contents

Synopsis

Basic union and product types

type :*: a b = (a, b)Source

type :+: a b = Either a bSource

Basic group and ring structure

Classes

class Semigroup m whereSource

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)

Methods

(+) :: m -> m -> mSource

class (Semigroup a, Semigroup b) => SubSemi a b whereSource

Methods

to :: b -> aSource

Instances

Monoid a => SubSemi a () 

class Semigroup m => Monoid m whereSource

A monoid is a semigroup with a null element such that zero + a == a + zero == a

Methods

zero :: mSource

Instances

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) 

class Monoid m => Ring m whereSource

Methods

one :: mSource

(*) :: m -> m -> mSource

Instances

Ring Bool 
Ring Float 
Ring Int 
Ring Integer 
(Applicative f, Contravariant f, Ring r) => Ring (f r) 
Ring m => Ring (Dual m) 
Ring w => Ring (Id w) 
Ring (f a) => Ring (Backwards f a) 

class Unit f whereSource

Methods

pure :: a -> f aSource

Instances

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

newtype Endo k a Source

A monoid on category endomorphisms under composition

Constructors

Endo 

Fields

runEndo :: k a a
 

Instances

Category k => Monoid (Endo k a) 
Category k => Semigroup (Endo k a) 

newtype Dual m Source

The dual of a monoid is the same as the original, with arguments reversed

Constructors

Dual 

Fields

getDual :: m
 

Instances

Ring m => Ring (Dual m) 
Monoid m => Monoid (Dual m) 
Semigroup m => Semigroup (Dual m) 

newtype OrdList a Source

An ordered list

Constructors

OrdList 

Fields

getOrdList :: [a]
 

Instances

Fundamental control operations

class Category k whereSource

Methods

id :: k a aSource

(.) :: k b c -> k a b -> k a cSource

Instances

Category (->) 
Monad m => Category (Kleisli m) 

class Category k => Choice k whereSource

Methods

(<|>) :: k a c -> k b c -> k (a :+: b) cSource

Instances

Choice (->) 
Monad m => Choice (Kleisli m) 

class Category k => Split k whereSource

Methods

(<#>) :: k a c -> k b d -> k (a, b) (c, d)Source

Instances

Split (->) 
Monad m => Split (Kleisli m) 

Misc functions

const :: Unit f => a -> f aSource

(&) :: b -> (b -> c) -> cSource

first :: Split k => k a c -> k (a, d) (c, d)Source

second :: Split k => k b d -> k (c, b) (c, d)Source

left :: Choice k => k a c -> k (:+: a c) cSource

right :: Choice k => k b c -> k (:+: c b) cSource

ifThenElse :: Bool -> t -> t -> tSource

guard :: (Unit f, Monoid (f ())) => Bool -> f ()Source

fail :: [Char] -> aSource

The rest is imported from the Prelude

module Prelude