Commit Graph

4240 Commits

Author SHA1 Message Date
Asumu Takikawa
9a4ee81604 Add TR case-lambda with optional type annotations
original commit: 58a3d12f0c1e27b2ea45bcb1c8ee1243825d28b1
2014-02-20 13:54:32 -05:00
Asumu Takikawa
4216d01b2d TR: move helper syntax classes to helper file
original commit: ed98404aafea1f9d0142dabdba73dcf7f16dda73
2014-02-20 12:05:11 -05:00
Asumu Takikawa
f57a8f5e96 Add test for PR 13937
The actual bug was already fixed by enabling multi-valued
sequence syntax in TR `for` loop forms.

Closes PR 13937

original commit: 8d4b3ee396a645a828594b7b9afdcaf7e5676ccd
2014-02-20 00:06:45 -05:00
Asumu Takikawa
9ee89f821d Document legacy forms with a : suffix
Also don't export internal macros

original commit: a17e4578404b7eb243e1b7dbfb749b1df6e44215
2014-02-19 21:20:48 -05:00
Asumu Takikawa
43060c8d37 Revise TR Reference for new :-less forms
original commit: 768d04fa975097097af18d2fae1be108cbf3abbe
2014-02-19 16:40:40 -05:00
Asumu Takikawa
4f2bd7180f Provide :-less versions of all for forms.
Modify the forms as needed to accept non-annotated
bindings to match the untyped versions. Also fixes
bugs in syntax classes found along the way.

original commit: 37b09521ac3493ed45963aedacf7a263194aec1a
2014-02-19 16:40:40 -05:00
Asumu Takikawa
28cba9af4a Accept polydots rest in TR lambda and define
Also accept type variables before formals in all cases

original commit: 35ef2f90ebef94c8f7c4e46fc43c03b6ce329a41
2014-02-19 16:40:40 -05:00
Asumu Takikawa
088e5d700f Enable mixed type annotations for define
original commit: 3d177e454ea3634060a4b9b0814f588bc7c74e49
2014-02-19 16:40:40 -05:00
Asumu Takikawa
5cfd64eb33 Support polymorphism in both TR let and lambda
original commit: 967490cb229c3ef4d70960f6b0075d8e28f21ea9
2014-02-19 16:40:40 -05:00
Asumu Takikawa
ca951c418c Add :-less versions of struct macros
original commit: 45d36579d3823f024a7448ed9efc552aa90b9b0f
2014-02-19 16:40:40 -05:00
Asumu Takikawa
861d303db5 Add a :-less do for TR
original commit: a941f95c2e117829b729d75f815c868630a5869f
2014-02-19 16:40:40 -05:00
Asumu Takikawa
b5f3811937 Make :-less versions of let variants in TR
original commit: e6e3ab4e74f95585d01ae66df048ee6ee76088b1
2014-02-19 16:40:40 -05:00
Asumu Takikawa
6ffd6fc72c Add support for rest arguments in TR plain lambda
Two caveats:
  * in some positions : is not accepted as a formal
    when used in combination with * as a formal
  * the quality of parse error messages for rest
    argument types is traded for better optional argument
    error messages

original commit: a3d818c748b09dd07043460ad412a19d0f94b47c
2014-02-19 16:40:40 -05:00
Asumu Takikawa
ca0c7f3f35 Better error messages for TR lambda parsing
original commit: ad4f6e1ea1f9c0e2e7ca30e6ea6d8c6e8a50f0ca
2014-02-19 16:40:40 -05:00
Asumu Takikawa
f1fbe180e2 Incorporate PR feedback
original commit: aef37edae4fdeea89960bdaff6abe7d474e91218
2014-02-19 16:40:40 -05:00
Asumu Takikawa
ad79633b49 Improve type-checker for optional arg functions
original commit: eb7a0f87974f9bdeba8819cfbd7899773eae019b
2014-02-19 16:40:40 -05:00
Asumu Takikawa
4338551c6c Allow TR lambda to have a result type annotation
original commit: 7e09362986ea09bcfd68894c83331ecc0ca7cee4
2014-02-19 16:40:39 -05:00
Asumu Takikawa
91b02494df Improve TR lambda to accommodate type annotations
The new `lambda` form allows all combinations of arguments
with optional type annotations for all cases.

original commit: 8ea32c68f61a0bfad6b162302bc3c0ff28870361
2014-02-19 16:40:39 -05:00
Asumu Takikawa
5b642ef79d Fix TR double cast bug
In some cases, TR tried to typecheck the contents of a quote-syntax
form that contains unexpanded syntax.

Closes PR 14355

original commit: 26204cf505f885827854908391d2842476728c8b
2014-02-18 23:28:49 -05:00
Asumu Takikawa
1fecbdb182 Add typed/pict which exports part of pict
Does not cover all of the bindings yet, but it
should just be a SMOP after the last extra-env-lang
feature additions.

original commit: 0c0befac075a137158c568f93397c9bea4a109b2
2014-02-18 18:43:57 -05:00
Asumu Takikawa
c8595e7e45 Improve TR's extra-env-lang
Instead of parsing the module's body like env-lang,
export a `type-environment` form instead. That way
the module may contain any auxiliary definitions
or expressions that are needed.

Additionally allow #:opaque and #:struct clauses
for opaque and struct types in the base type environment.

Update typed/syntax/stx for the new API.

original commit: db51fdb8fdc943971122fea32a7b593b187bd685
2014-02-18 18:43:57 -05:00
Vincent St-Amour
1b78da2bf6 Swap remaining unsafe and chaperone-unsafe operation in the TR optimizer.
Fixes the fix in aba046a92d42.

original commit: 1d1d8bacad035fc1609f7444dd207a92b395d5ae
2014-02-17 18:41:18 -05:00
Asumu Takikawa
720544b95c Improve type inference for ListDots
This provides better inference for the case when trying
to infer a ListDots in a negative position against a List
type. For example, when trying to apply `time-apply`.

original commit: 18adcb5b041be12994eb65d86bde5dc1f164cca7
2014-02-16 11:35:55 -05:00
Asumu Takikawa
08e8a6eeb1 Fix TR regression and use abstraction recipe
A function like (lambda (x) (lambda (y) y)) would cause TR
to fail in an internal metafunction. The fault was triggered
when the object y is abstracted to (0 0) and then the outer
lambda tries to abstract (0 0) and fails.

The problem was triggered by the new path index changes in
v6.0 because TR did not previously try to abstract objects
that occurs in the target type (now necessary for scope
lifting of path indices), which may contain non-identifier
objects.

This error didn't occur in another nearly identical (except
for one crucial identifier? check) code path, so this commit
also eliminates the duplication by abstracting.

original commit: bf47523ac92f2d3b32e6c97aa83d9d256b449a6f
2014-02-15 00:14:47 -05:00
Asumu Takikawa
fae843b628 Update TR doc pkg dependencies
original commit: d32e0eda7cd18b6c61d68a224a8f35a91fce2b15
2014-02-14 19:15:42 -05:00
Asumu Takikawa
055caf7d7b Add a top blurb to the TR Reference
original commit: 6fd39d78d74ec66bb97ce18110e279e151c42e8d
2014-02-14 17:33:02 -05:00
Asumu Takikawa
0e9e628d79 Add a TR Guide section about ->* and optional args
original commit: a9b09f29103339a761c0a158a8ae0e409f74ab0c
2014-02-14 17:24:23 -05:00
Asumu Takikawa
54458fdb51 Use prefix -> in the TR Guide examples
Also some minor fixes like using the more common
case-> form rather than case-lambda.

original commit: 1c5f6714a878dca04c2a0f392733993bb4425a2b
2014-02-14 17:12:36 -05:00
Asumu Takikawa
0150e379f2 Add diagrams from Vincent's PADL paper to TR docs
original commit: f59a122841a15748a7be4c4128ef2793a2a3bcd4
2014-02-14 16:38:31 -05:00
Asumu Takikawa
f42081cca9 Reorganize documentation for -> form in TR
Put examples next to relevant prose, add more examples,
and add more cross-references.

original commit: 6ad1af3741fbdbdc5796ee7db07f42550ac7677f
2014-02-13 13:21:02 -05:00
Asumu Takikawa
0d51c5aa2c Fix TR reference typo
original commit: 4b580a8b8dd3a5920b55cdb8f394d710b5945de0
2014-02-13 01:34:51 -05:00
Asumu Takikawa
8487bf8485 Document the new prefix function type constructors
original commit: 277051fcf10e1b66ccc80e7cc064ed796097119e
2014-02-13 01:20:10 -05:00
Asumu Takikawa
1a43d2fa9d Adjust printing of -> and ->*
Use prefix printing in all cases, and add indentation
rules for pretty printing

original commit: 72c9de99e0d4b59db897c034838426f6ef5892d3
2014-02-13 01:20:06 -05:00
Asumu Takikawa
f2caa4b293 Improve error messages from : annotation form
Emit errors in terms of the original user-supplied syntax,
not the helper macro syntax

original commit: 36524740c873ba8c28202e9abc10adf0cf4618c6
2014-02-13 00:23:01 -05:00
Asumu Takikawa
c05dafbc58 Apply All's rules for parentheses omission for :
original commit: 8e8df77fc4675a5f8a9ae8090ac87b35c36dfaf7
2014-02-13 00:23:01 -05:00
Asumu Takikawa
d2f1ea2fc6 Do not allow parentheses omission for prefix ->
Also fix multiple -> detection, which was broken

original commit: 7bb537fc828854d3f5d59b88f84db1caab50aa5e
2014-02-13 00:23:01 -05:00
Asumu Takikawa
7f5638df9c Use syntax classes to parse ->* type constructors
original commit: 6ec287f9f6abbfe7b42c7e00831a6aad4f5fbdc9
2014-02-13 00:22:59 -05:00
Asumu Takikawa
2badae67b0 Print ->* style types with ->* constructor
This recognizes the type for a function like
`regexp-match?` and will print it concisely.

original commit: 54f72050a631c45785b95bdfaca9877db41bc3b8
2014-02-13 00:22:24 -05:00
Asumu Takikawa
502aac42fe Lift out partition-kws function into util module
original commit: 97fe6b82b4ff6d781fe214e3b12500f10587c69e
2014-02-13 00:20:53 -05:00
Asumu Takikawa
6a9b828018 Abstract out function that checks ->* style types
original commit: 40bf3ad2437f3419cc876cf147f3430f118eb62f
2014-02-13 00:20:53 -05:00
Asumu Takikawa
66ecebc74a Add ->* type constructor for optional arguments
original commit: 02dd958a697bf897a412f24547dfd07d11a62b72
2014-02-13 00:20:47 -05:00
Asumu Takikawa
345e7854d9 Allow prefix function arrow type
Also fix a regression that made arrow type
parsing more permissive than desired due to
missing colon^s

original commit: 7dc5143f145c5bbb95f97d9ae7cee751b0f466ef
2014-02-13 00:15:35 -05:00
Vincent St-Amour
1549252c7b Fix TR optimizer test.
original commit: 6c08632f359f9d8c3adccc7780e7c731fd2fb9cf
2014-02-11 14:06:21 -05:00
Vincent St-Amour
e0f4cc9f9f Make flvectors and fxvectors subtypes of sequences.
original commit: 1e591a51243b87b65a6f892dfc9ba5fe3f4da263
2014-02-11 14:06:21 -05:00
Vincent St-Amour
500f8645d7 Simplify types for flvector and fxvector operations.
original commit: e2254414d238495333bd60cb1fb450d055462439
2014-02-11 10:28:50 -05:00
Asumu Takikawa
1a916e17f8 Add in-flvector, in-fxvector to TR base environment
original commit: 11bfdce6859a2615a7456a7f30123771eeee528e
2014-02-11 01:28:31 -05:00
Asumu Takikawa
95afd01fde Add FxVector type to Typed Racket
The `for` forms for fxvectors are future work

original commit: 6791b322ec8dedf7cc2d00aca4aa12df4d0567c2
2014-02-11 01:23:19 -05:00
Asumu Takikawa
8b46b0199a Add an ignore-table for TR's optimizer
This allows the typechecker to tell the optimizer or
other downstream analyses what expressions to ignore
because they contain non-typechecked code.

Use it to fix handling of `send`

original commit: 2b9b16b165cecd1285e80545efee84bf340ac36d
2014-02-10 23:57:58 -05:00
Asumu Takikawa
8646081d73 Refactor type-table
Move the provides to the top following the style guide and
add a purpose statement for the module

original commit: c72228dee8602df89373eb5eb4f3547825ebbb64
2014-02-10 23:57:57 -05:00
Asumu Takikawa
77f961bd64 Add other future/place primitives to TR base-env
Also fixed the type of `place-dead-evt`.

original commit: 72ef0a9323ba0cf5000423b73797cd03e6f5ba4f
2014-02-08 09:49:11 -05:00