Commit bc23e4c
authored
Add type inference module for embedding polymorphic types (#299)
* first commit
* format
* test passes
* types
* add docstring with doctests for unify
* more test cases
* case
* docstring and test cases for infer_return_type
* canonicalize
* fixes
* fix error type
* add _nested_type for sequences
* make _nested_type singledispatch extensible
* term case
* nit
* docstrings and tests for canonicalize and nested_type
* no notimmplentederror
* variadic params
* remove dead code paths in unify
* simplify unify
* union
* tweak
* cleanup
* fix none case
* more aggressive canonicalize applied only during unification
* update canonicalize test
* remove dead path
* paramspec failure
* literal and optional
* paramspec canonicalize
* simplify alias
* single unify call
* fast paths
* union handling
* freshen
* type of freshen
* reorder
* fixpoint in substitute
* tweak types
* empty params
* tweak substitute type
* doctest
* separate nested_type
* handle defaults
* update
* remove test ids
* add to sphinx
* fix doctests
* fix type checking
* str
* lint and format
* freshen -> _freshen
* factor out freetypevars and susbtitute
* truncate names
* doctest
* doctest
* add compositional tests
* add tests for function types
* ellipsis and paramspec
* variadic tuple logic and union tests
* fix union unify pattern
* Use unification to implement `Operation.__type_rule__` (#300)
* Use infer_return_type to implement Operation.__type_rule__
* move some logic out of infer_return_type
* dont add defaults
* update
* remove duplicate default param logic
* fix and format
* lint
* fix semiring test
* address comment
* update to 3.12
* union
* try truncating??
* tweaks
* split up expression in _freshen
* no parallel build
* revert script
* break expressions u
* script
* try again with old script??
* rewrite
* simplify
* finer error type
* pin jax
* use typing internal api for substitute and freetypevars, and make canonicalize more robust
* internal api
* revert api
* add test
* fix doctest
* remove unused var
* address some comments
* default attr
* union soundness
* fix union and add variadic assertion
* reinstate support for bounds to make tests pass
* nodefault
* lint
* forwardref1 parent c424c3c commit bc23e4c
8 files changed
Lines changed: 2632 additions & 81 deletions
File tree
- docs/source
- effectful
- internals
- ops
- tests
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
98 | 98 | | |
99 | 99 | | |
100 | 100 | | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
62 | 62 | | |
63 | 63 | | |
64 | 64 | | |
65 | | - | |
| 65 | + | |
66 | 66 | | |
67 | 67 | | |
68 | 68 | | |
69 | 69 | | |
70 | | - | |
| 70 | + | |
71 | 71 | | |
72 | 72 | | |
73 | 73 | | |
74 | 74 | | |
75 | | - | |
| 75 | + | |
76 | 76 | | |
77 | 77 | | |
78 | 78 | | |
| |||
92 | 92 | | |
93 | 93 | | |
94 | 94 | | |
95 | | - | |
96 | | - | |
97 | | - | |
98 | | - | |
99 | | - | |
100 | | - | |
101 | | - | |
102 | | - | |
103 | | - | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
104 | 98 | | |
105 | 99 | | |
106 | 100 | | |
107 | 101 | | |
108 | | - | |
| 102 | + | |
109 | 103 | | |
110 | 104 | | |
111 | 105 | | |
| |||
215 | 209 | | |
216 | 210 | | |
217 | 211 | | |
218 | | - | |
| 212 | + | |
219 | 213 | | |
220 | 214 | | |
221 | 215 | | |
| |||
0 commit comments