diff --git a/graph-lib/graph/graph.lp2.rkt b/graph-lib/graph/graph.lp2.rkt index 763aed7a..fc60d5b3 100644 --- a/graph-lib/graph/graph.lp2.rkt +++ b/graph-lib/graph/graph.lp2.rkt @@ -324,8 +324,9 @@ arguments, tagged with the @tc[node]'s name): @; TODO: maybe replace node types with placeholder types +@chunk[ + (struct (A) node/placeholder-struct ([f : A]) #:transparent)] @chunk[ - (struct (A) node/placeholder-struct ([f : A]) #:transparent) (define-type node/placeholder-type (node/placeholder-struct (List param-type …)))] @@ -350,9 +351,10 @@ indicates at which index in the queue's results the successor can be found. @; TODO: use a type-expander here, instead of a template metafunction. -@CHUNK[ - (struct node/index-type ([i : Index]) #:transparent) +@chunk[ + (struct node/index-type ([i : Index]) #:transparent)] +@chunk[ (define-type node/with-indices-type (List 'node/with-indices-tag …)) @@ -361,7 +363,7 @@ indicates at which index in the queue's results the successor can be found. (define (node/make-with-indices field …) (list 'node/with-indices-tag field …))] -@CHUNK[ +@chunk[ (tmpl-replace-in-type field-type [node node/index-type] …)] @subsection{Making with-promises nodes} @@ -617,26 +619,32 @@ We will be able to use this type expander in function types, for example: (begin ) … (begin ) … + ;; TODO: Struct definitions have to be outside due to TR bug #192 + ;; https://github.com/racket/typed-racket/issues/192 + (begin ) … + (begin ) … (splicing-let ([mapping node/make-placeholder] … [node node/make-incomplete] …) - (?? (begin extra-definition …)) - (begin ) …) - (begin ) … - (begin ) … - (begin ) … - (begin ) … - (begin ) … - - (begin ) … - - (: fq (case→ (→ 'node/placeholder-queue node/placeholder-type - (List (Vectorof node/with-indices-type) …)) - …)) - (define (fq queue-name placeholder) - ) - - ))))] + (?? (begin extra-definition …)) + + (begin ) … + + (begin ) … + (begin ) … + (begin ) … + (begin ) … + (begin ) … + + (begin ) … + + (: fq (case→ (→ 'node/placeholder-queue node/placeholder-type + (List (Vectorof node/with-indices-type) …)) + …)) + (define (fq queue-name placeholder) + ) + + )))))] @chunk[ (begin