[racket] Typed Racket - Recursive Types (Little help please)

From: Ray Racine (ray.racine at gmail.com)
Date: Thu Jul 19 18:07:30 EDT 2012

#lang typed/racket/base

;; Inputs
(define-type (Stream D) (U (Datum D) 'Nothing 'EOS))
(struct: (D) Datum ([iota : D]))

;; Iteratee
(define-type (Iteratee D A) (U (Done D A) (Continuation D A)))
(struct: (D A) Done ([accum : A] [stream : (Stream D)]))
(struct: (D A) Continuation ([resume : ((Stream D) -> (Iteratee D A))]))

1.  How can I get the recursive nature of Iteratee and Continuation to type
check?
2.  Ideally, but not necessary, like to define Continuation as a
 define-struct/exec:

Thanks,

Ray
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.racket-lang.org/users/archive/attachments/20120719/77fa0ce3/attachment.html>

Posted on the users mailing list.