:query-result-type -> :query-type/result
Result type is given, not asked for.
This commit is contained in:
parent
28c85dfd25
commit
d87339d414
|
@ -200,8 +200,8 @@ This file defines two sorts of primitives. All of them are provided into any mod
|
|||
(error ":type is only valid at the top-level of an interaction"))
|
||||
(define-syntax (:print-type stx)
|
||||
(error ":print-type is only valid at the top-level of an interaction"))
|
||||
(define-syntax (:query-result-type stx)
|
||||
(error ":query-result-type is only valid at the top-level of an interaction"))
|
||||
(define-syntax (:query-type/result stx)
|
||||
(error ":query-type/result is only valid at the top-level of an interaction"))
|
||||
|
||||
(define-syntax (require/opaque-type stx)
|
||||
(define-syntax-class name-exists-kw
|
||||
|
|
|
@ -10,7 +10,7 @@
|
|||
(typecheck provide-handling tc-toplevel tc-app-helper)
|
||||
(rep type-rep)
|
||||
(env env-req)
|
||||
(for-template (only-in (base-env prims) :type :print-type :query-result-type))
|
||||
(for-template (only-in (base-env prims) :type :print-type :query-type/result))
|
||||
(utils utils tc-utils arm)
|
||||
"tc-setup.rkt" "utils/debug.rkt")
|
||||
|
||||
|
@ -62,7 +62,7 @@
|
|||
[(tc-result1: t f o) t]
|
||||
[(tc-results: t) (cons 'Values t)])))))]
|
||||
;; given a function and a desired return type, fill in the blanks
|
||||
[(_ . ((~literal :query-result-type) op:expr desired-type:expr))
|
||||
[(_ . ((~literal :query-type/result) op:expr desired-type:expr))
|
||||
(let ([expected (parse-type #'desired-type)])
|
||||
(tc-setup #'stx #'op 'top-level expanded init tc-toplevel-form before type
|
||||
(match type
|
||||
|
|
|
@ -14,6 +14,6 @@ The following bindings are only available at the Typed Racket REPL.
|
|||
@defform[(:print-type e)]{Prints the type of @racket[_e]. This prints the whole
|
||||
type, which can sometimes be quite large.}
|
||||
|
||||
@defform[(:query-result-type f t)]{Given a function @racket[f] and a desired
|
||||
@defform[(:query-type/result f t)]{Given a function @racket[f] and a desired
|
||||
return type @racket[t], shows the arguments types @racket[f] should be given to
|
||||
return a value of type @racket[t].}
|
||||
|
|
Loading…
Reference in New Issue
Block a user