www

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

commit 8499defa8a8071873c678b1bf3664322dfc1f009
parent 679f6f1783dffd21054d27d7c7aa615bc010d6f5
Author: Georges Dupéron <georges.duperon@gmail.com>
Date:   Thu, 20 Apr 2017 14:55:14 +0200

Renamed worklist → worklist-function and work → worklist

Diffstat:
Mexperiment.rkt | 14+++++++-------
Mtest/test-experiment.rkt | 28++++++++++++++--------------
2 files changed, 21 insertions(+), 21 deletions(-)

diff --git a/experiment.rkt b/experiment.rkt @@ -1,12 +1,12 @@ #lang typed/racket -(provide work) +(provide worklist) (require (only-in type-expander unsafe-cast)) ;; TODO: write a macro wrapper which does the unsafe-cast (until the bug in TR ;; is fixed), and (un)wraps the inputs and outputs. -(provide worklist) +(provide worklist-function) (struct (A) I ([v : A]) #:transparent) (struct (A) O ([v : A]) #:transparent) @@ -55,13 +55,13 @@ (define-type I* (I Any)) (define-type O* (O Any)) -(: worklist +(: worklist-function (∀ (A ...) (case→ (→ (List (Listof (∩ A I*)) ...) (List (→ (∩ A I*) (List (∩ A O*) (Listof (∩ A I*)) ...)) ...) (List (Listof (Pairof (∩ A I*) (∩ A O*))) ...))))) -(define (worklist roots processors) +(define (worklist-function roots processors) (define nulls (map (λ (_) (ann '() (Listof Nothing))) processors)) (define empty-sets (map list->set nulls)) @@ -113,7 +113,7 @@ (define-syntax-rule (inst-worklist (In Out) ...) (unsafe-cast - (inst worklist + (inst worklist-function (U (I In) (O Out)) ...) ;; cast to its own type, circumventing the fact that TR doesn't seem to apply @@ -167,14 +167,14 @@ ...) new-l)) -(define-syntax-rule (work roots (proc ...) (In Out) ... ) +(define-syntax-rule (worklist roots (proc ...) (In Out) ... ) (unwrap-io ((inst-worklist (In Out) ...) (i** roots) (list (wrap-io proc) ...)) (proc 'dummy) ...)) -(work (list (list 7) +(worklist (list (list 7) (list)) [(λ ([x : Integer]) (list (number->string x) diff --git a/test/test-experiment.rkt b/test/test-experiment.rkt @@ -1,16 +1,16 @@ #lang typed/racket (require "../experiment.rkt") -(work (list (list 7) - (list)) - [(λ ([x : Integer]) - (list (number->string x) - (list (if (> x 0) (sub1 x) 0)) - (list (string->symbol - (string-append "v" (number->string x)))))) - (λ ([x : Symbol]) - (list (eq? 'v5 x) - (list 10) - (list 'xyz)))] - (Integer String) - (Symbol Boolean)) -\ No newline at end of file +(worklist (list (list 7) + (list)) + [(λ ([x : Integer]) + (list (number->string x) + (list (if (> x 0) (sub1 x) 0)) + (list (string->symbol + (string-append "v" (number->string x)))))) + (λ ([x : Symbol]) + (list (eq? 'v5 x) + (list 10) + (list 'xyz)))] + (Integer String) + (Symbol Boolean)) +\ No newline at end of file