www

Unnamed repository; edit this file 'description' to name the repository.
Log | Files | Refs | README

main.rkt (566B)


      1 #lang typed/racket/base
      2 
      3 (require typed/racket/unsafe)
      4 
      5 (provide IVectorof
      6          (rename-out [new-ivector ivector]))
      7 
      8 (unsafe-require/typed tr-immutable/private/unsafe
      9                       [#:struct (A) ivector ([v : (Listof A)])
     10                        #:constructor-name make-ivector
     11                        #:type-name IVectorof])
     12 
     13 (: new-ivector (∀ (A) (→ A * (IVectorof A))))
     14 (define (new-ivector . vs)
     15   (make-ivector vs))
     16 
     17 ;TODO: do a (with-sexp (var) body) which transforms to isexp on input, and back
     18 ; to sexp on output, to prevent any obvious leaks?