Skip to content

Commit 1c6a74f

Browse files
ellyxirulysses4ever
authored andcommitted
use monospace for all Haskell keywords in prose, drop hyphens from compound terms, use block instead of clause/section
1 parent 8a2edd1 commit 1c6a74f

6 files changed

Lines changed: 159 additions & 159 deletions

source_md/functors-applicative-functors-and-monoids.md

Lines changed: 56 additions & 56 deletions
Large diffs are not rendered by default.

source_md/higher-order-functions.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,7 @@ From the definition of sections, `(-4)` would result in a function that takes a
130130
However, for convenience, `(-4)` means minus four.
131131
So if you want to make a function that subtracts 4 from the number it gets as a parameter, partially apply the `subtract` function like so: `(subtract 4)`.
132132

133-
What happens if we try to just do `multThree 3 4` in GHCi instead of binding it to a name with a *let* or passing it to another function?
133+
What happens if we try to just do `multThree 3 4` in GHCi instead of binding it to a name with a `let` or passing it to another function?
134134

135135
```{.haskell:hs}
136136
ghci> multThree 3 4
@@ -495,7 +495,7 @@ To make a lambda, we write a `\` (because it kind of looks like the greek letter
495495
After that comes a `->` and then the function body.
496496
We usually surround them by parentheses, because otherwise they extend all the way to the right.
497497

498-
If you look about 5 inches up, you'll see that we used a *where* binding in our `numLongChains` function to make the `isLong` function for the sole purpose of passing it to `filter`.
498+
If you look about 5 inches up, you'll see that we used a `where` binding in our `numLongChains` function to make the `isLong` function for the sole purpose of passing it to `filter`.
499499
Well, instead of doing that, we can use a lambda:
500500

501501
```{.haskell:hs}
@@ -960,7 +960,7 @@ Many times, a point free style is more readable and concise, because it makes yo
960960
You can take simple functions and use composition as glue to form more complex functions.
961961
However, many times, writing a function in point free style can be less readable if a function is too complex.
962962
That's why making long chains of function composition is discouraged, although I plead guilty of sometimes being too composition-happy.
963-
The preferred style is to use *let* bindings to give labels to intermediary results or split the problem into sub-problems and then put it together so that the function makes sense to someone reading it instead of just making a huge composition chain.
963+
The preferred style is to use `let` bindings to give labels to intermediary results or split the problem into sub-problems and then put it together so that the function makes sense to someone reading it instead of just making a huge composition chain.
964964

965965
In the section about maps and filters, we solved a problem of finding the sum of all odd squares that are smaller than 10,000.
966966
Here's what the solution looks like when put into a function.

0 commit comments

Comments
 (0)