syndicate-2017/racket/typed/tests/effect-polymorhpism.rkt

23 lines
635 B
Racket
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

#lang typed/syndicate
(require rackunit/turnstile)
(define ( (ρ) (assert-something! [p : (proc ★/t #:effects (ρ))]))
(p))
(define (test-fun)
(call/inst assert-something! (lambda () (assert 5))))
(check-type test-fun : (proc ★/t #:effects ((Shares NonZero))))
(define (test-call/inst-insertion)
(assert-something! (lambda () (assert 5))))
(check-type test-call/inst-insertion : (proc ★/t #:effects ((Shares NonZero))))
(define ( (ρ) (start-something! [p : (proc ★/t #:effects (ρ))]))
(p))
(define (test-call-start-something)
(start-something! (lambda () (start-facet x (assert 5)))))