Skip to content

Commit 31f16de

Browse files
committed
Docs
1 parent fa2c186 commit 31f16de

File tree

4 files changed

+18
-64
lines changed

4 files changed

+18
-64
lines changed

docs/Control.Alt.md

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ This module defines the `Alt` type class.
99

1010
``` purescript
1111
class (Functor f) <= Alt f where
12-
(<|>) :: forall a. f a -> f a -> f a
12+
alt :: forall a. f a -> f a -> f a
1313
```
1414

1515
The `Alt` type class identifies an associative operation on a type
@@ -25,5 +25,13 @@ types of kind `* -> *`, like `Array` or `List`, rather than concrete types
2525
For example, the `Array` (`[]`) type is an instance of `Alt`, where
2626
`(<|>)` is defined to be concatenation.
2727

28+
#### `(<|>)`
29+
30+
``` purescript
31+
(<|>) :: forall f a. (Alt f) => f a -> f a -> f a
32+
```
33+
34+
An infix version of `alt`.
35+
2836

2937

docs/Control.Alternative.md

Lines changed: 0 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -21,28 +21,5 @@ laws:
2121
- Distributivity: `(f <|> g) <*> x == (f <*> x) <|> (g <*> x)`
2222
- Annihilation: `empty <*> f = empty`
2323

24-
#### `some`
25-
26-
``` purescript
27-
some :: forall f a. (Alternative f, Lazy (f [a])) => f a -> f [a]
28-
```
29-
30-
Attempt a computation multiple times, requiring at least one success.
31-
32-
The `Lazy` constraint is used to generate the result lazily, to ensure
33-
termination.
34-
35-
#### `many`
36-
37-
``` purescript
38-
many :: forall f a. (Alternative f, Lazy (f [a])) => f a -> f [a]
39-
```
40-
41-
Attempt a computation multiple times, returning as many successful results
42-
as possible (possibly zero).
43-
44-
The `Lazy` constraint is used to generate the result lazily, to ensure
45-
termination.
46-
4724

4825

docs/Control.Extend.md

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ This module defines the `Extend` type class and associated helper functions.
99

1010
``` purescript
1111
class (Functor w) <= Extend w where
12-
(<<=) :: forall b a. (w a -> b) -> w a -> w b
12+
extend :: forall b a. (w a -> b) -> w a -> w b
1313
```
1414

1515
The `Extend` class defines the extension operator `(<<=)`
@@ -30,6 +30,14 @@ instance extendArr :: (Semigroup w) => Extend (Prim.Function w)
3030
```
3131

3232

33+
#### `(<<=)`
34+
35+
``` purescript
36+
(<<=) :: forall w a b. (Extend w) => (w a -> b) -> w a -> w b
37+
```
38+
39+
An infix version of `extend`
40+
3341
#### `(=>>)`
3442

3543
``` purescript
@@ -54,14 +62,6 @@ Forwards co-Kleisli composition.
5462

5563
Backwards co-Kleisli composition.
5664

57-
#### `extend`
58-
59-
``` purescript
60-
extend :: forall b a w. (Extend w) => (w a -> b) -> w a -> w b
61-
```
62-
63-
An alias for `(<<=)`.
64-
6565
#### `duplicate`
6666

6767
``` purescript

docs/Control.Monad.md

Lines changed: 0 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -5,22 +5,6 @@
55

66
This module defines helper functions for working with `Monad` instances.
77

8-
#### `replicateM`
9-
10-
``` purescript
11-
replicateM :: forall m a. (Monad m) => Int -> m a -> m [a]
12-
```
13-
14-
Perform a monadic action `n` times collecting all of the results.
15-
16-
#### `foldM`
17-
18-
``` purescript
19-
foldM :: forall m a b. (Monad m) => (a -> b -> m a) -> a -> [b] -> m a
20-
```
21-
22-
Perform a fold using a monadic step function.
23-
248
#### `when`
259

2610
``` purescript
@@ -37,20 +21,5 @@ unless :: forall m. (Monad m) => Boolean -> m Unit -> m Unit
3721

3822
Perform a monadic action unless a condition is true.
3923

40-
#### `filterM`
41-
42-
``` purescript
43-
filterM :: forall a m. (Monad m) => (a -> m Boolean) -> [a] -> m [a]
44-
```
45-
46-
Filter where the predicate returns a monadic `Boolean`.
47-
48-
For example:
49-
50-
```purescript
51-
powerSet :: forall a. [a] -> [[a]]
52-
powerSet = filterM (const [true, false])
53-
```
54-
5524

5625

0 commit comments

Comments
 (0)