
Most unit forms are supported, including most of the "infer" forms that infer imports/exports/linkages from the current context. Notably, none of the structural linking forms for units are supported, and `define-unit-binding` is also currently unsupported.
21 lines
492 B
Racket
21 lines
492 B
Racket
#lang racket
|
|
|
|
(module typed typed/racket
|
|
(provide (all-defined-out))
|
|
(define-signature x^ ([x : Integer]))
|
|
(define u (unit (import x^) (export) (lambda ([n : Integer]) (+ n x)))))
|
|
|
|
(module untyped racket
|
|
(require (submod ".." typed))
|
|
(define v (unit (import) (export x^) (define x 11)))
|
|
(define w (compound-unit
|
|
(import)
|
|
(export)
|
|
(link (([X : x^]) v)
|
|
(() u X))))
|
|
|
|
(define f (invoke-unit w))
|
|
(f 6))
|
|
|
|
(require 'untyped)
|