Skip to content

Commit f7e6cb5

Browse files
committed
Consistency
1 parent 78c1d02 commit f7e6cb5

File tree

9 files changed

+44
-42
lines changed

9 files changed

+44
-42
lines changed

README.md

Lines changed: 22 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
## Module Control.Alt
44

55

6-
This module defines the `Alt` type class
6+
This module defines the `Alt` type class.
77

88
#### `Alt`
99

@@ -140,15 +140,15 @@ This module defines helper functions for working with `Bind` instances.
140140
(=<<) :: forall a b m. (Bind m) => (a -> m b) -> m a -> m b
141141
```
142142

143-
A version of `(>>=)` with its arguments reversed
143+
A version of `(>>=)` with its arguments flipped.
144144

145145
#### `(>=>)`
146146

147147
``` purescript
148148
(>=>) :: forall a b c m. (Bind m) => (a -> m b) -> (b -> m c) -> a -> m c
149149
```
150150

151-
Forwards Kleisli composition
151+
Forwards Kleisli composition.
152152

153153
For example:
154154

@@ -164,7 +164,7 @@ third = tail >=> tail >=> head
164164
(<=<) :: forall a b c m. (Bind m) => (b -> m c) -> (a -> m b) -> a -> m c
165165
```
166166

167-
Backwards Kleisli composition
167+
Backwards Kleisli composition.
168168

169169
#### `join`
170170

@@ -194,7 +194,7 @@ main = ifM ((< 0.5) <$> random)
194194
## Module Control.Comonad
195195

196196

197-
This module defines the `Comonad` type class
197+
This module defines the `Comonad` type class.
198198

199199
#### `Comonad`
200200

@@ -218,7 +218,7 @@ Laws:
218218
## Module Control.Extend
219219

220220

221-
This module defines the `Extend` type class and associated helper functions
221+
This module defines the `Extend` type class and associated helper functions.
222222

223223
#### `Extend`
224224

@@ -251,55 +251,55 @@ instance extendArr :: (Semigroup w) => Extend (Prim.Function w)
251251
(=>>) :: forall b a w. (Extend w) => w a -> (w a -> b) -> w b
252252
```
253253

254-
A version of `(<<=)` with its arguments reversed
254+
A version of `(<<=)` with its arguments flipped.
255255

256256
#### `(=>=)`
257257

258258
``` purescript
259259
(=>=) :: forall b a w c. (Extend w) => (w a -> b) -> (w b -> c) -> w a -> c
260260
```
261261

262-
Forwards co-Kleisli composition
262+
Forwards co-Kleisli composition.
263263

264264
#### `(=<=)`
265265

266266
``` purescript
267267
(=<=) :: forall b a w c. (Extend w) => (w b -> c) -> (w a -> b) -> w a -> c
268268
```
269269

270-
Backwards co-Kleisli composition
270+
Backwards co-Kleisli composition.
271271

272272
#### `duplicate`
273273

274274
``` purescript
275275
duplicate :: forall a w. (Extend w) => w a -> w (w a)
276276
```
277277

278-
Duplicate a comonadic context
278+
Duplicate a comonadic context.
279279

280-
`duplicate` is dual to `join`.
280+
`duplicate` is dual to `Control.Bind.join`.
281281

282282

283283
## Module Control.Functor
284284

285285

286-
This module defines helper functions for working with `Functor` instances
286+
This module defines helper functions for working with `Functor` instances.
287287

288288
#### `(<$)`
289289

290290
``` purescript
291291
(<$) :: forall f a b. (Functor f) => a -> f b -> f a
292292
```
293293

294-
Ignore the return value of a computation, using the specified return value instead
294+
Ignore the return value of a computation, using the specified return value instead.
295295

296296
#### `($>)`
297297

298298
``` purescript
299299
($>) :: forall f a b. (Functor f) => f a -> b -> f b
300300
```
301301

302-
A version of `(<$)` with its arguments flipped
302+
A version of `(<$)` with its arguments flipped.
303303

304304

305305
## Module Control.Lazy
@@ -328,7 +328,7 @@ class Lazy1 l where
328328
defer1 :: forall a. (Unit -> l a) -> l a
329329
```
330330

331-
A version of `Lazy` for type constructors of one type argument
331+
A version of `Lazy` for type constructors of one type argument.
332332

333333
#### `Lazy2`
334334

@@ -337,7 +337,7 @@ class Lazy2 l where
337337
defer2 :: forall a b. (Unit -> l a b) -> l a b
338338
```
339339

340-
A version of `Lazy` for type constructors of two type arguments
340+
A version of `Lazy` for type constructors of two type arguments.
341341

342342
#### `fix`
343343

@@ -355,37 +355,37 @@ The `Lazy` instance allows us to generate the result lazily.
355355
fix1 :: forall l a. (Lazy1 l) => (l a -> l a) -> l a
356356
```
357357

358-
A version of `fix` for type constructors of one type argument
358+
A version of `fix` for type constructors of one type argument.
359359

360360
#### `fix2`
361361

362362
``` purescript
363363
fix2 :: forall l a b. (Lazy2 l) => (l a b -> l a b) -> l a b
364364
```
365365

366-
A version of `fix` for type constructors of two type arguments
366+
A version of `fix` for type constructors of two type arguments.
367367

368368

369369
## Module Control.Monad
370370

371371

372-
This module defines helper functions for working with `Monad` instances
372+
This module defines helper functions for working with `Monad` instances.
373373

374374
#### `replicateM`
375375

376376
``` purescript
377377
replicateM :: forall m a. (Monad m) => Number -> m a -> m [a]
378378
```
379379

380-
Perform a monadic action `n` times collecting all of the results
380+
Perform a monadic action `n` times collecting all of the results.
381381

382382
#### `foldM`
383383

384384
``` purescript
385385
foldM :: forall m a b. (Monad m) => (a -> b -> m a) -> a -> [b] -> m a
386386
```
387387

388-
Perform a fold using a monadic step function
388+
Perform a fold using a monadic step function.
389389

390390
#### `when`
391391

@@ -476,6 +476,7 @@ class (Alt f) <= Plus f where
476476

477477
The `Plus` type class extends the `Alt` type class with a value that
478478
should be the left and right identity for `(<|>)`.
479+
479480
It is similar to `Monoid`, except that it applies to types of
480481
kind `* -> *`, like `Array` or `List`, rather than concrete types like
481482
`String` or `Number`.

src/Control/Alt.purs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
-- | This module defines the `Alt` type class
1+
-- | This module defines the `Alt` type class.
22

33
module Control.Alt where
44

src/Control/Bind.purs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,11 @@ module Control.Bind where
66
infixr 1 >=>
77
infixr 1 <=<
88

9-
-- | A version of `(>>=)` with its arguments reversed
9+
-- | A version of `(>>=)` with its arguments flipped.
1010
(=<<) :: forall a b m. (Bind m) => (a -> m b) -> m a -> m b
1111
(=<<) f m = m >>= f
1212

13-
-- | Forwards Kleisli composition
13+
-- | Forwards Kleisli composition.
1414
-- |
1515
-- | For example:
1616
-- |
@@ -22,7 +22,7 @@ module Control.Bind where
2222
(>=>) :: forall a b c m. (Bind m) => (a -> m b) -> (b -> m c) -> a -> m c
2323
(>=>) f g a = f a >>= g
2424

25-
-- | Backwards Kleisli composition
25+
-- | Backwards Kleisli composition.
2626
(<=<) :: forall a b c m. (Bind m) => (b -> m c) -> (a -> m b) -> a -> m c
2727
(<=<) f g a = f =<< g a
2828

src/Control/Comonad.purs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
-- | This module defines the `Comonad` type class
1+
-- | This module defines the `Comonad` type class.
22

33
module Control.Comonad where
44

src/Control/Extend.purs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
-- | This module defines the `Extend` type class and associated helper functions
1+
-- | This module defines the `Extend` type class and associated helper functions.
22

33
module Control.Extend where
44

@@ -23,20 +23,20 @@ class (Functor w) <= Extend w where
2323
instance extendArr :: (Semigroup w) => Extend ((->) w) where
2424
(<<=) f g w = f \w' -> g (w <> w')
2525

26-
-- | A version of `(<<=)` with its arguments reversed
26+
-- | A version of `(<<=)` with its arguments flipped.
2727
(=>>) :: forall b a w. (Extend w) => w a -> (w a -> b) -> w b
2828
(=>>) w f = f <<= w
2929

30-
-- | Forwards co-Kleisli composition
30+
-- | Forwards co-Kleisli composition.
3131
(=>=) :: forall b a w c. (Extend w) => (w a -> b) -> (w b -> c) -> w a -> c
3232
(=>=) f g w = g (f <<= w)
3333

34-
-- | Backwards co-Kleisli composition
34+
-- | Backwards co-Kleisli composition.
3535
(=<=) :: forall b a w c. (Extend w) => (w b -> c) -> (w a -> b) -> w a -> c
3636
(=<=) f g w = f (g <<= w)
3737

38-
-- | Duplicate a comonadic context
38+
-- | Duplicate a comonadic context.
3939
-- |
40-
-- | `duplicate` is dual to `join`.
40+
-- | `duplicate` is dual to `Control.Bind.join`.
4141
duplicate :: forall a w. (Extend w) => w a -> w (w a)
4242
duplicate w = id <<= w

src/Control/Functor.purs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
1-
-- | This module defines helper functions for working with `Functor` instances
1+
-- | This module defines helper functions for working with `Functor` instances.
22

33
module Control.Functor where
44

55
infixl 4 <$
66
infixl 4 $>
77

8-
-- | Ignore the return value of a computation, using the specified return value instead
8+
-- | Ignore the return value of a computation, using the specified return value instead.
99
(<$) :: forall f a b. (Functor f) => a -> f b -> f a
1010
(<$) x f = const x <$> f
1111

12-
-- | A version of `(<$)` with its arguments flipped
12+
-- | A version of `(<$)` with its arguments flipped.
1313
($>) :: forall f a b. (Functor f) => f a -> b -> f b
1414
($>) f x = const x <$> f

src/Control/Lazy.purs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,11 +11,11 @@ module Control.Lazy where
1111
class Lazy l where
1212
defer :: (Unit -> l) -> l
1313

14-
-- | A version of `Lazy` for type constructors of one type argument
14+
-- | A version of `Lazy` for type constructors of one type argument.
1515
class Lazy1 l where
1616
defer1 :: forall a. (Unit -> l a) -> l a
1717

18-
-- | A version of `Lazy` for type constructors of two type arguments
18+
-- | A version of `Lazy` for type constructors of two type arguments.
1919
class Lazy2 l where
2020
defer2 :: forall a b. (Unit -> l a b) -> l a b
2121

@@ -25,10 +25,10 @@ class Lazy2 l where
2525
fix :: forall l a. (Lazy l) => (l -> l) -> l
2626
fix f = defer (\_ -> f (fix f))
2727

28-
-- | A version of `fix` for type constructors of one type argument
28+
-- | A version of `fix` for type constructors of one type argument.
2929
fix1 :: forall l a. (Lazy1 l) => (l a -> l a) -> l a
3030
fix1 f = defer1 (\_ -> f (fix1 f))
3131

32-
-- | A version of `fix` for type constructors of two type arguments
32+
-- | A version of `fix` for type constructors of two type arguments.
3333
fix2 :: forall l a b. (Lazy2 l) => (l a b -> l a b) -> l a b
3434
fix2 f = defer2 (\_ -> f (fix2 f))

src/Control/Monad.purs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,16 @@
1-
-- | This module defines helper functions for working with `Monad` instances
1+
-- | This module defines helper functions for working with `Monad` instances.
22

33
module Control.Monad where
44

5-
-- | Perform a monadic action `n` times collecting all of the results
5+
-- | Perform a monadic action `n` times collecting all of the results.
66
replicateM :: forall m a. (Monad m) => Number -> m a -> m [a]
77
replicateM 0 _ = return []
88
replicateM n m = do
99
a <- m
1010
as <- replicateM (n - 1) m
1111
return (a : as)
1212

13-
-- | Perform a fold using a monadic step function
13+
-- | Perform a fold using a monadic step function.
1414
foldM :: forall m a b. (Monad m) => (a -> b -> m a) -> a -> [b] -> m a
1515
foldM _ a [] = return a
1616
foldM f a (b:bs) = f a b >>= \a' -> foldM f a' bs

src/Control/Plus.purs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ import Control.Alt
66

77
-- | The `Plus` type class extends the `Alt` type class with a value that
88
-- | should be the left and right identity for `(<|>)`.
9+
-- |
910
-- | It is similar to `Monoid`, except that it applies to types of
1011
-- | kind `* -> *`, like `Array` or `List`, rather than concrete types like
1112
-- | `String` or `Number`.

0 commit comments

Comments
 (0)