summaryrefslogtreecommitdiff
path: root/haskell
diff options
context:
space:
mode:
authorTom Smeding <tom@tomsmeding.com>2021-09-14 14:45:50 +0200
committerTom Smeding <tom@tomsmeding.com>2021-09-14 14:45:50 +0200
commitcc3b4084bc328023b20cdf14ea6e9be1f86d940c (patch)
tree34fbf3130b6bb878a7933825a1822a19778ad685 /haskell
parent85ffc2927b0eb5daedcd5a1c455518e985aed526 (diff)
Fix typo in haskell/composition
Diffstat (limited to 'haskell')
-rw-r--r--haskell/composition.html2
-rw-r--r--haskell/composition.md2
2 files changed, 2 insertions, 2 deletions
diff --git a/haskell/composition.html b/haskell/composition.html
index d1d4afc..1d3d013 100644
--- a/haskell/composition.html
+++ b/haskell/composition.html
@@ -123,7 +123,7 @@ This is exactly like you may have learned that subtraction is left-associative (
(.) :: (b -&gt; c) -&gt; (a -&gt; b) -&gt; (a -&gt; c)
(.) :: (b -&gt; c) -&gt; ((a -&gt; b) -&gt; (a -&gt; c))
</code></pre>
-<p><small>(Why can't we remove the parentheses around the <code>b -&gt; c</code> and <code>a -&gt; c</code> in there? That is because it the type would then suddenly mean something different. Try to work that out for yourself!)</small></p>
+<p><small>(Why can't we remove the parentheses around the <code>b -&gt; c</code> and <code>a -&gt; b</code> in there? That is because it the type would then suddenly mean something different. Try to work that out for yourself!)</small></p>
<p>We can read this as: <code>(.)</code> takes a function <code>g :: b -&gt; c</code>, a function <code>f :: a -&gt; b</code> and a value <code>x :: a</code>.
It applies <code>f</code> to <code>x</code>, applies <code>g</code> to the result, and returns the result of that.
Indeed, <code>(.)</code> can be implemented like this:</p>
diff --git a/haskell/composition.md b/haskell/composition.md
index f6754a5..14f84cb 100644
--- a/haskell/composition.md
+++ b/haskell/composition.md
@@ -176,7 +176,7 @@ Now look again at the type of `(.)` (all three mean the same):
(.) :: (b -> c) -> ((a -> b) -> (a -> c))
```
-<small>(Why can't we remove the parentheses around the `b -> c` and `a -> c` in there? That is because it the type would then suddenly mean something different. Try to work that out for yourself!)</small>
+<small>(Why can't we remove the parentheses around the `b -> c` and `a -> b` in there? That is because it the type would then suddenly mean something different. Try to work that out for yourself!)</small>
We can read this as: `(.)` takes a function `g :: b -> c`, a function `f :: a -> b` and a value `x :: a`.
It applies `f` to `x`, applies `g` to the result, and returns the result of that.