Commit Graph

74 Commits

Author SHA1 Message Date
Vincent St-Amour
e2007abd7a Heterogenous -> heterogenEous.
Found by Ray Racine.
2012-11-20 17:06:51 -05:00
Asumu Takikawa
d22532db16 Fix Custodian type 2012-11-10 11:12:06 -05:00
Sam Tobin-Hochstadt
0a0ac35ee6 Correctly bind place? for contract generation. 2012-11-07 12:21:09 -05:00
Sam Tobin-Hochstadt
f2fd47905f Fix binding of udp?. 2012-10-31 21:39:16 -04:00
Sam Tobin-Hochstadt
5861bf0b9f Make Typed Racket name printing more deterministic. 2012-10-28 13:55:02 -04:00
Sam Tobin-Hochstadt
962f2472e1 Revamp handling of Any as a contract.
The contract now has two major differences:
 - It raises an error when it would have to wrap.
 - It uses chaperones to delay errors as long as possible

In general, using `Any` as a type when exporting to untyped
code will now just work, unless the untyped code tries to
communicate values back to the typed side, in which case an
immediate error will be raised.

Much of the implementation comes from the membrane design
from [Strickland et al, OOPSLA 2012].
2012-10-05 12:39:11 -04:00
Sam Tobin-Hochstadt
b3c640870e Simplify fast path for typechecking simple function applications.
Also, minorly revise subtyping code.
2012-10-05 12:12:39 -04:00
Eric Dobson
8a8dc66a19 Replace uses of Type? in contracts with Type/c. 2012-09-27 18:10:38 -04:00
Eric Dobson
cf4d43c04f Made free-variance have less special cases. 2012-09-27 16:22:22 -04:00
Eric Dobson
ffe45ecce4 Working covariant applications. 2012-09-27 16:22:22 -04:00
Eric Dobson
12233600c1 Fix -struct to use the right number of arguments to make-Struct. 2012-09-27 16:22:21 -04:00
Eric Dobson
2a8512ed72 Removed unused fields in Struct 2012-09-27 16:22:21 -04:00
Sam Tobin-Hochstadt
eed93825ab Track mutable variables across modules. 2012-08-31 17:45:11 -04:00
Sam Tobin-Hochstadt
ab5403d1ed Simplifying case-> to union is only safe for 1-argument functions.
Closes PR 13002.
2012-08-31 10:27:51 -04:00
Eric Dobson
e9f209977b Fix typechecking of polymorphic structs with parent types.
Closes PR12998.
2012-08-22 16:50:49 -04:00
Eric Dobson
df6562c1de Make promises like every other TR container. 2012-08-14 16:16:07 -04:00
Eric Dobson
ac493a6f44 Replaced infer-dummy with lazy-require. 2012-08-14 16:04:51 -04:00
Eric Dobson
9ef80edfef Fix internal error for untyped kw functions.
Closes PR12932.
Closes PR12922.
2012-08-14 16:04:51 -04:00
Eric Dobson
3b6168de7d Fix substitute and add test case. 2012-08-14 14:44:55 -04:00
Eric Dobson
2e3965e777 Make simple substitution happen all at once.
Closes pr12920.
2012-08-14 14:44:55 -04:00
Sam Tobin-Hochstadt
fddd5c63ff Minor printer refactoring. 2012-08-14 09:58:01 -04:00
Eric Dobson
cac47c0427 Make TR debug printer work again. 2012-08-14 09:45:01 -04:00
Eric Dobson
c9afe15f56 Cleanup TR printer to use lazy-require. 2012-08-14 09:45:01 -04:00
Vincent St-Amour
4b30d052b0 Allow multi-line printing of case-> types.
Currently only used in :print-type. Everywhere else, types are pruned.
2012-08-07 16:31:52 -04:00
Sam Tobin-Hochstadt
7eaae20f41 Add back some special cases. 2012-08-07 15:51:02 -04:00
Eric Dobson
21598297a7 Removed *Un from abbrev.rkt, replaced it with Un from union.rkt. 2012-08-07 15:50:50 -04:00
Eric Dobson
9ed360bb5e Removed convenience.rkt from typed racket. 2012-08-07 15:50:50 -04:00
Eric Dobson
56fd9e6321 Rearange type code, so that abbrev.rkt can depend on union.rkt.
Split out base-abbrev.rkt so that subtype is not dependent on abbrev.rkt.
Remove unused code in numeric-tower.rkt so that it is now a dependent of
abbrev.rkt, which allows the body of convenience.rkt to be merged back in.
Remove special casing for union.rkt and extraneous subtyping checks.
Remove union-maker.
2012-08-07 15:50:50 -04:00
Eric Dobson
6dbc054e41 Replaced references to abbrev.rkt with convenience.rkt.
Skipped this for subtype.rkt, because of a require loop caused by
lazy-require.
2012-08-07 15:50:50 -04:00
Vincent St-Amour
a6d5a98b61 Include NaN in all floating-point types.
Makes more closure properties hold, but weakens occurrence typing for
some comparisons involving flonums.
2012-08-03 14:21:44 -04:00
Sam Tobin-Hochstadt
4a90c6c1fe Ensure that structs don't overlap with simple values.
Reported by Ray Racine.

Please merge to release.
2012-07-20 13:01:32 -04:00
Eric Dobson
3dfd4c52a9 Fix bad contract and clashing provides in TR when contracts are enabled. 2012-07-15 19:21:25 -04:00
Eric Dobson
030e56311e Make TR compile cleanly with contracts enabled.
Added a couple of contracts and fixed some others up as well.
The two bugs were that with-contract was not imported, and that
subtype could be called with Values and Results.
2012-07-15 19:21:11 -04:00
Sam Tobin-Hochstadt
9e097866bf Vector fixes.
- Allow indexing into a VectorTop, with result `Any`.
- Don't use special typing rules for applications when the operator
  has an annotation or instantiation.

Closes PR 12887.
Closes PR 12888.
2012-07-14 21:30:26 -04:00
Sam Tobin-Hochstadt
418a0c311b Print StructTop nicely.
Related to PR 12903.
2012-07-14 18:41:42 -04:00
Sam Tobin-Hochstadt
4cba6e010f Intern Struct types properly wrt. identifiers. 2012-07-13 17:10:50 -04:00
Sam Tobin-Hochstadt
683f8e4e4b Use promises for current-type-names. 2012-07-13 17:10:50 -04:00
Sam Tobin-Hochstadt
396b04eb86 Reduce some dependencies of Typed Racket prims. 2012-07-12 17:41:12 -04:00
Sam Tobin-Hochstadt
6bf141513f Revise type environment propagation to use submodules.
Each typed module now defines a submodule named `type-decl`.
This module performs the type environment initialization (along
with other environment updates) when invoked.  Additionall,
every typed module, when invoked, performs a for-syntax addition
to a list specifying the submodules that need invocation.
This invocation is then performed by the `#%module-begin` from
Typed Racket.

The `type-decl` module always goes at the beginning of the
expanded module, so that it's available at syntax-time for all
the other submodules.  This involved adding pre- and post-
syntaxes for the results of typechecking.

This allows significant runtime dependency reduction from the
main `typed/racket` and `typed/racket/base` languages (not yet
complete).
2012-07-10 12:49:27 -04:00
Neil Toronto
419b59e88e Added inline hint around `index?' definition; my own timing suggests 2x speedup 2012-07-09 19:15:35 -07:00
Sam Tobin-Hochstadt
20e95f8d8e More refactoring and reduction of runtime dependencies. 2012-06-28 14:34:07 -04:00
Sam Tobin-Hochstadt
f075ecd36e File splitting, dependency reduction. 2012-06-28 14:34:07 -04:00
Sam Tobin-Hochstadt
94f1cb2127 Avoid requiring the printer unneccesarily. 2012-06-25 18:07:45 -04:00
Sam Tobin-Hochstadt
c61ed30d0b Depend only on the lowest-level place primitives. 2012-06-25 18:07:45 -04:00
Sam Tobin-Hochstadt
794bfa50ec Load environments dynamically in residual code. 2012-06-25 18:07:45 -04:00
Sam Tobin-Hochstadt
88ff5fee69 Minor refactorings.
- Remove tracing requires.
 - Use lists instead of sets in a few environments.
 - Small cleanups.
2012-06-25 18:07:45 -04:00
Sam Tobin-Hochstadt
a05acfee4c Split out some small utilities to prepare to reduce dependencies. 2012-06-25 14:10:18 -04:00
Sam Tobin-Hochstadt
ccb724155a scheme -> racket 2012-06-25 13:39:07 -04:00
Neil Toronto
8f840bd07b Fixed erroneously imprecise type for +nan.f literal (now Single-Flonum-Nan)
Types for nan?, infinite?, pi.f, exact-round, exact-floor, exact-ceiling,
exact-truncate, degrees->radians, radians->degrees

Extended tc-random-testing: generates exact integers and rationals now

Fixed types of sinh, cosh and tanh to account for underflow and NaNs
2012-06-09 17:46:04 -06:00
Sam Tobin-Hochstadt
865a2cdcbd Support definitions of keyword functions in Typed Racket.
Caveats:
 - keyword function definitions do not define static
   bindings, thus limiting optimization opportunities
 - can't use `define:`, `lambda:`, etc with keywords
 - error messages sometimes expose the implementation
 - the optimizer skips most of the generated code for
   keyword functions definitions (user-level code is
   optimized)
2012-06-02 18:22:07 -04:00