Nice. Thank you.<br><br>On Thursday, July 19, 2012, Carl Eastlund <<a href="mailto:cce@ccs.neu.edu">cce@ccs.neu.edu</a>> wrote:<br>> This works if you expand the use of Iteratee within the definition of<br>> Continuation. Mutually-recursive polymorphic types are problematic,<br>
> but Continuation is only actually singly-recursive. You can still<br>> have the definition Iteratee for outside use.<br>><br>> Carl Eastlund<br>><br>> #lang typed/racket/base<br>><br>> ;; Inputs<br>
> (define-type (Stream D) (U (Datum D) 'Nothing 'EOS))<br>> (struct: (D) Datum ([iota : D]))<br>><br>> ;; Iteratee<br>> (define-type (Iteratee D A) (U (Done D A) (Continuation D A)))<br>> (struct: (D A) Done ([accum : A] [stream : (Stream D)]))<br>
> (struct: (D A) Continuation ([resume : ((Stream D) -> (U (Done D A)<br>> (Continuation D A)))]))<br>><br>><br>> On Thu, Jul 19, 2012 at 6:07 PM, Ray Racine <<a href="mailto:ray.racine@gmail.com">ray.racine@gmail.com</a>> wrote:<br>
>> #lang typed/racket/base<br>>><br>>> ;; Inputs<br>>> (define-type (Stream D) (U (Datum D) 'Nothing 'EOS))<br>>> (struct: (D) Datum ([iota : D]))<br>>><br>>> ;; Iteratee<br>
>> (define-type (Iteratee D A) (U (Done D A) (Continuation D A)))<br>>> (struct: (D A) Done ([accum : A] [stream : (Stream D)]))<br>>> (struct: (D A) Continuation ([resume : ((Stream D) -> (Iteratee D A))]))<br>
>><br>>> 1. How can I get the recursive nature of Iteratee and Continuation to type<br>>> check?<br>>> 2. Ideally, but not necessary, like to define Continuation as a<br>>> define-struct/exec:<br>
>><br>>> Thanks,<br>>><br>>> Ray<br>>