Finally remove all mentions of the old polytypes module.

It was merged with types long ago.
This commit is contained in:
Simon Forman
2020-04-25 15:59:31 -07:00
parent cdff2ea5ea
commit a66fd8d173
14 changed files with 153 additions and 38 deletions
+1 -1
View File
@@ -14,7 +14,7 @@ Type Checking
.. code:: ipython2
from joy.utils.polytypes import (
from joy.utils.types import (
doc_from_stack_effect,
infer,
reify,
+24 -6
View File
@@ -2821,9 +2821,9 @@ Work in Progress
And that brings us to current Work-In-Progress. The mixed-mode
inferencer/interpreter ``infer()`` function seems to work well. There
are details I should document, and the rest of the code in the
"polytypes" module (FIXME link to its docs here!) should be explained...
There is cruft to convert the definitions in ``DEFS`` to the new
are details I should document, and the rest of the code in the ``types``
module (FIXME link to its docs here!) should be explained... There is
cruft to convert the definitions in ``DEFS`` to the new
``SymbolJoyType`` objects, and some combinators. Here is an example of
output from the current code :
@@ -2842,6 +2842,25 @@ output from the current code :
for fi, fo in h:
print doc_from_stack_effect(fi, fo)
::
---------------------------------------------------------------------------
ZeroDivisionError Traceback (most recent call last)
<ipython-input-1-9a9d60354c35> in <module>()
----> 1 1/0 # (Don't try to run this cell! It's not going to work. This is "read only" code heh..)
2
3 logging.basicConfig(format='%(message)s', stream=sys.stdout, level=logging.INFO)
4
5 globals().update(FUNCTIONS)
ZeroDivisionError: integer division or modulo by zero
The numbers at the start of the lines are the current depth of the
Python call stack. They're followed by the current computed stack effect
(initialized to ``ID``) then the pending expression (the inference of
@@ -2922,9 +2941,8 @@ For *type checking* to work the type label classes have to be modified
to let ``T >= t`` succeed, where e.g. ``T`` is ``IntJoyType`` and ``t``
is ``int``. If you do that you can take advantage of the *logical
relational* nature of the stack effect comments to "compute in reverse"
as it were. There's a working demo of this at the end of the
``polytypes`` module. But if you're interested in all that you should
just use Prolog!
as it were. There's a working demo of this at the end of the ``types``
module. But if you're interested in all that you should just use Prolog!
Anyhow, type *checking* is a few easy steps away.