Skip to content

Commit

Permalink
Small fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
w7cook committed Sep 25, 2018
1 parent 0c9ae6a commit f3bc080
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 23 deletions.
35 changes: 12 additions & 23 deletions anatomy.lhs
Expand Up @@ -1761,18 +1761,6 @@ single binding. The next two variable declarations create environments %Eval21
Internally Haskell allows these two environments to share the definition
of the original environment |x| $\mapsto$ 3. %Eval24
It is useful to define an |execute| function that supplies the default, empty, environment: %Eval62
INCLUDE:DeclExec %Eval63
> executeX exp = show v
> where (v, _) = evaluate exp [] []
> -- %DeclExec
Here are some test cases for evaluating expressions with declarations: %Eval33
INCLUDE:DeclTest1
> -- %DeclTest1
The code for this section
is given in the
[Declare zip](./packages/Declare.zip) file. %Eval30
Expand Down Expand Up @@ -2041,7 +2029,7 @@ The previous version of this example contained an unbound use of the variable |m
The code that you must modify
is given in the
[Declare zip](./packages/Declare.zip) file. %Basi13
[Declare.zip](./packages/Declare.zip) file. %Basi13
= Functions
Expand Down Expand Up @@ -3619,20 +3607,20 @@ expression. %Envi3
Set current environment to empty environment $\emptyset$ %Envi5

* Case |Declare x e body| %Envi1
1. Draw binding box for |x| with unknown value %Envi6

Set parent of new binding to be the current environment %Envi16
2. Create the diagram for bound expression |e| %Envi7
1. Draw binding box for |x| with unknown value. %Envi6
Set parent of new binding to be the current environment. %Envi16
2. Create the diagram for bound expression |e|. %Envi7

Put the value of |e| into the binding as the value of |x| %Envi17
3. Set current environment to be the new binding %Envi18
4. Draw diagram for |body| and remember value %Envi19
5. Set current environment back to what it was before %Envi8
Put the value of |e| into the binding as the value of |x|. %Envi17
3. Set current environment to be the new binding. %Envi18
4. Draw diagram for |body| and remember value. %Envi19
5. Set current environment back to what it was before. %Envi8

* Case |Call fun arg| %Envi20
1. Draw diagram for |fun| %Envi9
1. Draw diagram for |fun|. If it is just a variable, then there is no diagram. %Envi9

Result must be a closure with variable |x|, |body| and |env| %Envi21
Result must be a closure with variable |x|, |body| and |env|. %Envi21
2. Make binding for argument using name |x| from closure %Envi10

Set parent of new binding to be the environment of the closure |env| %Envi22
Expand Down Expand Up @@ -6255,6 +6243,7 @@ In the file FirstClassFunctionsTest.hs you will also find several definitions
You can also optionally modify the Happy file to extend parsing so that we
can deal with type-annotations in the language. %TInt13
Here is a package of Haskell files for [Typing](./packages/Typing.zip).
--------------------BEGIN-HIDE------------------------- %Memo2
Expand Down
13 changes: 13 additions & 0 deletions notes.txt
@@ -0,0 +1,13 @@
FIgure 4.2: second closure should have b.

4.4.6: problem with proof has a circle in PDF

problem with BooleanF type

explain orF



Sukiyabashi Jiro.


0 comments on commit f3bc080

Please sign in to comment.