[racket] fingertree / nested datatype

From: Eric Dobson (eric.n.dobson at gmail.com)
Date: Sat Apr 13 03:23:41 EDT 2013

I believe this is the issue that the the check is trying to prevent.

Sam, can you explain how the indirection is supposed to solve this?

What is currently happening is we ask:
(subtype (Deep Number) (Deep Any)), which computes
(subtype (Indirect (List Number)) (Indirect (List Any))), which then computes
(subtype (Deep (List Number)) (Deep (List Any))), and then repeats.

On Fri, Apr 12, 2013 at 5:40 PM, Anthony Carrico <acarrico at memebeam.org> wrote:
> On 04/11/2013 08:51 AM, Sam Tobin-Hochstadt wrote:
>> Yes, an explicit struct involves an explicit indirection, and thus
>> produces a regular tree.
>
> Using Eric's example:
>
> #lang typed/racket
>
> (struct: (a) Indirect ((v : (Deep a))))
> (struct: (a) Deep ((spine : (Indirect (List a)))))
> ;(struct: (a) Deep ((spine : (Deep (List a)))))
>
> This checks fine, but try to use it:
>
> (: test ((Deep Number) -> Boolean))
> (define (test ft) (Deep? ft))
>
> And it hangs. So maybe indirection just pushes the problem somewhere else?
>
> --
> Anthony Carrico
>
>
> ____________________
>   Racket Users list:
>   http://lists.racket-lang.org/users
>

Posted on the users mailing list.