REPL for Typed Racket modules
Created by: khinsen
When entering a Typed Racket module, the Geiser REPL seems to remain at the standard Racket level. An illustration:
- Create a file "test.rkt" containing
#lang typed/racket
(require math/array)
(define arr
(build-array #(4 5) (lambda: ([js : Indexes])
(match-define (vector j0 j1) js)
(+ j0 j1))))
(array+ arr arr)
- Load this into the REPL (^U ^C ^Q). The REPL window shows
Welcome to Racket v5.90.0.9.
racket@> ,enter "/Users/hinsen/projects/racket/arrays.rkt"
(array #[#[0 2 4 6 8] #[2 4 6 8 10] #[4 6 8 10 12] #[6 8 10 12 14]])
- : Any
- Copy-paste the last expression,
(array+ arr arr)
, directly into the REPL:
racket@arrays.rkt> (array+ arr arr)
stdin::144: Type Checker: The type of array-map cannot be converted to a contract
in: (typed:array-map + arr arr)
errortrace...:
context...:
temp49
/Users/hinsen/Development/racket/pkgs/typed-racket-pkgs/typed-racket-lib/typed-racket/typed-racket.rkt:53:4
/Users/hinsen/Applications/Racket/collects/racket/private/misc.rkt:87:7
The same code works fine in a REPL run from a terminal (racket -I typed/racket
).