Skip to content

Commit

Permalink
Add type signatures to spec (#147)
Browse files Browse the repository at this point in the history
  • Loading branch information
scott-christopher authored and SimonRichardson committed Sep 5, 2016
1 parent 466ac6c commit 31f28fb
Showing 1 changed file with 52 additions and 0 deletions.
52 changes: 52 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,10 @@ have dependencies on other algebras which must be implemented.

#### `equals` method

```hs
equals :: Setoid a => a ~> a -> Boolean
```

A value which has a Setoid must provide an `equals` method. The
`equals` method takes one argument:

Expand All @@ -129,6 +133,10 @@ A value which has a Setoid must provide an `equals` method. The

#### `concat` method

```hs
concat :: Semigroup a => a ~> a -> a
```

A value which has a Semigroup must provide a `concat` method. The
`concat` method takes one argument:

Expand All @@ -151,6 +159,10 @@ the Semigroup specification.

#### `empty` method

```hs
empty :: Monoid m => () -> m
```

A value which has a Monoid must provide an `empty` method on itself or
its `constructor` object. The `empty` method takes no arguments:

Expand All @@ -166,6 +178,10 @@ its `constructor` object. The `empty` method takes no arguments:

#### `map` method

```hs
map :: Functor f => f a ~> (a -> b) -> f b
```

A value which has a Functor must provide a `map` method. The `map`
method takes one argument:

Expand All @@ -188,6 +204,10 @@ implement the Functor specification.

#### `ap` method

```hs
ap :: Apply f => f (a -> b) ~> f a -> f b
```

A value which has an Apply must provide an `ap` method. The `ap`
method takes one argument:

Expand All @@ -214,6 +234,10 @@ implement the Apply specification.

#### `of` method

```hs
of :: Applicative f => a -> f a
```

A value which has an Applicative must provide an `of` method on itself
or its `constructor` object. The `of` method takes one argument:

Expand All @@ -230,6 +254,10 @@ or its `constructor` object. The `of` method takes one argument:

#### `reduce` method

```hs
reduce :: Foldable f => f a ~> (b -> a -> b) -> b -> b
```

A value which has a Foldable must provide a `reduce` method. The `reduce`
method takes two arguments:

Expand Down Expand Up @@ -276,6 +304,10 @@ Compose.prototype.map = function(f) {

#### `sequence` method

```hs
sequence :: Apply f, Traversable t => t (f a) ~> (b -> f b) -> f (t a)
```

A value which has a Traversable must provide a `sequence` method. The `sequence`
method takes one argument:

Expand All @@ -292,6 +324,10 @@ implement the Apply specification.

#### `chain` method

```hs
chain :: Chain m => m a ~> (a -> m b) -> m b
```

A value which has a Chain must provide a `chain` method. The `chain`
method takes one argument:

Expand Down Expand Up @@ -319,6 +355,10 @@ the Applicative and Chain specifications.

#### `extend` method

```hs
extend :: Extend w => w a ~> (w a -> b) -> w b
```

An Extend must provide an `extend` method. The `extend`
method takes one argument:

Expand All @@ -342,6 +382,10 @@ A value that implements the Comonad specification must also implement the Functo

#### `extract` method

```hs
extract :: Comonad w => w a ~> () -> a
```

A value which has a Comonad must provide an `extract` method on itself.
The `extract` method takes no arguments:

Expand All @@ -360,6 +404,10 @@ the Functor specification.

#### `bimap` method

```hs
bimap :: Bifunctor f => f a c ~> (a -> b) -> (c -> d) -> f b d
```

A value which has a Bifunctor must provide an `bimap` method. The `bimap`
method takes two arguments:

Expand Down Expand Up @@ -387,6 +435,10 @@ the Functor specification.

#### `promap` method

```hs
promap :: Profunctor p => p b c ~> (a -> b) -> (c -> d) -> p a d
```

A value which has a Profunctor must provide a `promap` method.

The `profunctor` method takes two arguments:
Expand Down

0 comments on commit 31f28fb

Please sign in to comment.