Skip to content

Commit 004e2f7

Browse files
authored
Merge pull request #3 from siraben/explanation-typos
Fix typos in explanation.md
2 parents d55a9b5 + 9cd2bd6 commit 004e2f7

File tree

1 file changed

+9
-9
lines changed

1 file changed

+9
-9
lines changed

explanation.md

+9-9
Original file line numberDiff line numberDiff line change
@@ -255,13 +255,13 @@ which gives us an actual `Clos a`. Now for the third step we have
255255
`rebind`.
256256

257257
`rebind` maps a free variable to `Maybe Int`. It maps a free variable
258-
to it's binding occurrence it has one here. This boils down to using
258+
to its binding occurrence if has one. This boils down to using
259259
`elemIndex` to look up somethings position in the `Clos` we just built
260260
up. We also have a special case for when the variable we're looking at
261261
is the "argument" of the function we're fixing. In this case we want
262-
to map it to the last thing we're binding, which is just
263-
`length n`. To capture the "try this and then that" semantics we use
264-
the alternative instance for `Maybe` which works wonderfully.
262+
to map it to the last thing we're binding, which is just `length
263+
n`. To capture the "try this and then that" semantics we use the
264+
alternative instance for `Maybe` which works wonderfully.
265265

266266
With this, we've removed implicit closures from our language: one
267267
of the passes on our way to C.
@@ -291,7 +291,7 @@ Here's our new language.
291291
deriving (Eq, Functor, Foldable, Traversable)
292292
```
293293

294-
Much here is the same except we've romved both lambdas and fixpoints
294+
Much here is the same except we've removed both lambdas and fixpoints
295295
and replaced them with `LetL`. `LetL` works over bindings which are
296296
either recursive (`Fix`) or nonrecursive (`Lam`). Lambda lifting in
297297
this compiler is rather simplistic in how it lifts lambdas: we just
@@ -492,14 +492,14 @@ To lift a binding all we do is generate a globally unique identifier
492492
for the toplevel. Once we have that we that we can unwrap the
493493
particular binding we're looking at. This is going to comprise the
494494
body of the `TopC` function we're building. Since we need it to be
495-
`FauxC` code as well we recurse on it. No we have a bunch of faux-C
495+
`FauxC` code as well, we recurse on it. No we have a bunch of faux-C
496496
code for the body of the toplevel function. We then just repackage the
497497
body up into a binding (a `FauxCTop` needs one) and use `tell` to make
498498
a note of it. Once we've done that we return the stripped down let
499499
binding that just remembers the guid that we created for the toplevel
500500
function.
501501

502-
In an example, this code transformers
502+
In an example, this code transforms
503503

504504
``` haskell
505505
let x = λ (x : τ). ... in
@@ -601,7 +601,7 @@ The first few cases for conversion are nice and straightforward.
601601
We take advantage of the fact that `realc` returns it's result and we
602602
can almost make this look like the applicative cases we had
603603
before. One particularly slick case is how `Suc` works. We compute the
604-
value of `e` and apply the result to `suc`. We then feed this
604+
value of `e` and apply the result to `inc`. We then feed this
605605
expression into `tellDecl` which binds it to a fresh variable and
606606
returns the variable. Haskell is pretty slick.
607607

@@ -683,7 +683,7 @@ Next, we have a function for converting a faux C function into an
683683
actual function definition. This is the function that we use `realc`
684684
in.
685685

686-
```haskel
686+
``` haskell
687687
topc :: FauxCTop CExpr -> Gen Integer CFunDef
688688
topc (FauxCTop i numArgs body) = do
689689
binds <- gen

0 commit comments

Comments
 (0)