Skip to content

Commit c141ef1

Browse files
whayprMarekSuchanek
authored andcommitted
Fix typos
1 parent 3b4b2d4 commit c141ef1

1 file changed

Lines changed: 6 additions & 6 deletions

File tree

tutorials/05_typeclasses.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -256,7 +256,7 @@ class Show a where
256256

257257
This is for converting values to human-readable strings. The minimal requirement for custom instances: define `show`.
258258

259-
Derived `Show` produces a string that looks is a valid Haskell code. Custom instances can produce any string representation you want. But then you should preferably implement both Show and Read, they should round-trip: `read (show x) == x`. General recommendation: do not abuse `show` for pretty-printing.
259+
Derived `Show` produces a string that looks as a valid Haskell code. Custom instances can produce any string representation you want. But then you should preferably implement both Show and Read, they should round-trip: `read (show x) == x`. General recommendation: do not abuse `show` for pretty-printing.
260260

261261
### Read — parsing from String
262262

@@ -510,7 +510,7 @@ You already know some instances of `Monoid`:
510510

511511
Apart from basic `Monoid` from algebra, there are also other variants. You might find interesting to learn more about:
512512

513-
* [semigroupoids](https://hackage.haskell.org/package/semigroupoids/docs/Data-Groupoid.html) (Semigroupoid, Grupoid),
513+
* [semigroupoids](https://hackage.haskell.org/package/semigroupoids/docs/Data-Groupoid.html) (Semigroupoid, Groupoid),
514514
* [groups](https://hackage.haskell.org/package/groups/docs/Data-Group.html) (Group, Abelian),
515515
* etc.
516516

@@ -553,7 +553,7 @@ ghci> fmap (+10) (Left 5)
553553
Left 5 -- no change!
554554
555555
ghci> fmap (+10) (Right 5)
556-
Right 10 -- changed, because "Either c" is functor for whatever "c" - it doesn't care
556+
Right 15 -- changed, because "Either c" is functor for whatever "c" - it doesn't care
557557
```
558558

559559
Just as with Monoid, you can take a look at the documentation of [Data.Functor](https://hackage.haskell.org/package/base/docs/Data-Functor.html). Again, there is an operator alias, in this case `(<$>)` for `fmap` (denoting a sort of "wrapped" or "inside" apply). There are two more -- `<$` and `$>` (just flipped `<$`). Flipped version of `(<$>)` is `(<&>)`.
@@ -672,9 +672,9 @@ class Applicative m => Monad m where
672672
(>>) :: m a -> m b -> m b -- compose two actions, discarding the result
673673
return :: a -> m a -- inject a value into the monadic type.
674674

675-
-- (<**>):: f a -> f (a -> b) -> f b -- from Controll.Applicative
676-
-- (*>) :: f a -> f b -> f b -- from Controll.Applicative
677-
-- pure :: a -> f a -- from Controll.Applicative
675+
-- (<**>):: f a -> f (a -> b) -> f b -- from Control.Applicative
676+
-- (*>) :: f a -> f b -> f b -- from Control.Applicative
677+
-- pure :: a -> f a -- from Control.Applicative
678678
```
679679

680680
Function `return` works just as `pure` in `Applicative`. Why having two same functions? Historically; PureScript, for instance, has just `pure` both for the Applicative and Monad.

0 commit comments

Comments
 (0)