Safe HaskellSafe

Eta.Classes.Category

Description

The Category type class defines an interface for functions. You can create your own way of applying functions by instantiating this type class.

It defines two methods:

  • id for defining how does the identity function work
  • . for defining how the right-to-left function composition works

Synopsis

Documentation

class Category k cat where #

Minimal complete definition

id, (.)

Methods

id :: cat a a #

(.) :: cat b c -> cat a b -> cat a c #

Instances

Category k (Coercion k) 

Methods

id :: cat a a #

(.) :: cat b c -> cat a b -> cat a c #

Category k ((:~:) k) 

Methods

id :: cat a a #

(.) :: cat b c -> cat a b -> cat a c #

Category * (->) 

Methods

id :: cat a a #

(.) :: cat b c -> cat a b -> cat a c #

identity :: Category function => function a a #

The identity function, returns the parameter as it is

>>> identity 1
1

(>>>) :: Category k cat => cat a b -> cat b c -> cat a c #

(<<<) :: Category k cat => cat b c -> cat a b -> cat a c #