Commit Graph

32 Commits

Author SHA1 Message Date
Alex Knauth
bbcdfaf9cf add ~typecheck and ~⊢ pattern expanders (#6)
* add ~typecheck and ~⊢ pattern expanders

So that in normal macros, syntax classes, and normal syntax-parse
expressions, you can use use the Turnstile syntax to do typechecking

* add documentation for ~typecheck and ~⊢
2017-04-17 12:41:02 -07:00
Milo Turner
2e03856589 Listed #:as keyword available in define-primop 2017-04-04 15:01:09 -04:00
Milo Turner
02fbf9f6d5 Listed the syntax class attributes for type-bind, type-ctx, type-ann 2017-04-04 15:01:09 -04:00
Milo Turner
881912d1fd change some docs to adhere to the behavior of the code 2017-04-04 15:01:09 -04:00
Stephen Chang
115aae8e73 completely separate type and kind api, etc; generalize type environment
Previously, "type" functions were reused a lot to manipulate kinds, and other
metadata defined via `define-syntax-category`, but this meant it was impossible
to define separate behavior for some type and kind operations, e.g., type=? and
kind=?. This commit defines a separate api for each `define-syntax-category`
declaration.

Also, every `define-syntax-category` defines a new `define-NAMEd-syntax` form,
which implicitly uses the proper parameters, e.g., `define-kinded-syntax` uses
`kindcheck?`, `current-kind-eval`, and the ':: kind key by default (whereas
before, it was using typecheck?, type-eval, etc).

This commit breaks backwards compatibility. The most likely breakage results
from using a different default key for kinds. It used to be ':, the same as
types, but now the default is '::.

This commit also generalizes the contexts used with `define-NAMEd-syntax` and
`infer`.
- all contexts now accept arbitrary key-values associated with a variable
- all contexts use let* semantics, where a binding is in scope for subsequent
  bindings; this means that one environment is sufficient in most scenarioes,
  e.g., type and term vars can be mixed (if properly ordered)
- environments allow lone identifiers, which are treated as type variables by
  default
2017-02-08 13:07:24 -05:00
Stephen Chang
0084146c1c rename parse-typed-syntax to syntax-parse/typecheck; closes #50 again 2017-01-24 16:56:12 -05:00
Stephen Chang
896ec53151 document relation order for current-typecheck-relation; closes #48 2017-01-24 15:57:50 -05:00
Stephen Chang
b23ee8fc3f provide syntax-parse/typed-syntax as parse-typed-syntax
- but dont remove the old name
- closes #50
2017-01-24 14:51:03 -05:00
Stephen Chang
36c24c04b9 polish docs; explain #lang turnstile/lang and \succ form
closes #51
2017-01-24 12:59:02 -05:00
Stephen Chang
28fa5dd033 split def-kinded-stx from def-typed-stx; split any-type? from type?
- the former prevents using current-typecheck-relation at type/kind level
- the latter differentiates "well-formed" types (star)
  from valid types (any kind)
- move define-*ed-syntax and *-eval into define-syntax-category
- turnstile must wrap define-stx-category to define new define-*ed-syntax
- add any-*? pred and any-* stx class in def-stx-category
- fixes #44
- fixes #45
2016-10-14 14:16:49 -04:00
Stephen Chang
98568ceb99 add define-internal-type-constructor and define-internal-binding-type
- add fomega-no-reuse example
2016-10-13 21:21:05 -04:00
Stephen Chang
1c0fa751d6 split out a define-binding-type from define-type-constructor
- document #:arg-variances and variances; #:arr
- fixes #36
- start to split type constructor macro into (not working yet)
  - ty-: expands to expanded type representation
  - ty: performs kindchecking and expands to ty-
  - this makes it easier for programmers to implement their own kind
    system, but still get some turnstile conveniences like pat expanders
2016-10-13 15:20:30 -04:00
Stephen Chang
40a699cc81 [docs] minor edits to clarify binding phases 2016-10-12 14:52:10 -04:00
Stephen Chang
691ba9c51c Turnstile forms no longer automatically provide; add type-out
- not auto-providing more closely adheres to idiomatic Racket
- this commit changes:
  - define-typed-syntax
    - removed #:export-as option
  - define-base-type
    - removed #:no-provide option
  - define-type-constructor
    - removed #:no-provide option
- type-out helps with providing defined types
- in examples, move define and define-type-alias to ext-stlc
- fix bug in reuse where renamed id not provided
2016-10-12 10:46:05 -04:00
Stephen Chang
fc5731de00 dont auto provide define-primops; add typed-out 2016-10-09 18:12:12 -04:00
Stephen Chang
0e0d4ce192 [docs] extend explanation of current-type-eval 2016-10-04 14:46:34 -04:00
Stephen Chang
0d3b9b6550 [docs] add #:error conclusion 2016-10-03 16:01:36 -04:00
Stephen Chang
e8faad889b add τ= in addition to τ⊑ 2016-10-03 10:16:42 -04:00
AlexKnauth
41491136b6 put the guide and reference onto separate pages 2016-09-30 14:44:41 -04:00
AlexKnauth
0275d0143d use tc instead of inf and use . tc in the stx class 2016-09-30 14:07:07 -04:00
Stephen Chang
c78c085e60 [docs] dont include stx for-label 2016-09-30 12:53:21 -04:00
Stephen Chang
383634e14f polish and extend reference
- mention key in inf-elem
- specify phase of bindings
- add type=? examples
2016-09-30 12:09:37 -04:00
Ben Greenman
ffa0a05e26 [scribblings] respond to comments on PR #29
- add `#lang turnstile` to Sec 2.7
- use eval:error in @examples[]
- remove @literal
2016-09-30 10:14:03 -04:00
Ben Greenman
9116cfd5a2 [scribblings] typos & minor fixes to docs 2016-09-29 18:13:14 -04:00
Stephen Chang
2b6c1964c8 docs: fix remaining broken links; add some stx util fns 2016-09-26 14:38:16 -04:00
Stephen Chang
8183efe1a6 fix broken techlinks 2016-09-26 14:26:51 -04:00
Stephen Chang
7dd277e814 docs: add extends and reuse 2016-09-26 13:03:09 -04:00
Stephen Chang
853ef3f897 docs: update reference with predeclared forms 2016-09-26 12:21:00 -04:00
Stephen Chang
b898e255a5 docs: add #:export-as option in define-typed-syntax 2016-09-26 10:46:37 -04:00
Stephen Chang
94c7578ad6 docs: small reference edits 2016-09-26 10:46:37 -04:00
Stephen Chang
e68480f0e6 docs: reference rough draft 2016-09-26 10:46:37 -04:00
Stephen Chang
e5cedb5c33 refactor guide and reference into separate files 2016-09-26 10:46:37 -04:00