[plt-scheme] Recognizing Listof in typed-scheme

From: Sam TH (samth at ccs.neu.edu)
Date: Mon Apr 6 10:20:50 EDT 2009

On Mon, Apr 6, 2009 at 9:53 AM, Paulo J. Matos <pocmatos at gmail.com> wrote:
> Then I remembered that I should let typed-scheme know that every is a
> predicate for (Listof a), so I changed the typing to:
> (: every (All (a) ((a -> Boolean) (Listof a) -> Boolean : (Listof a))))
> But now I get an error in match:
> match: no matching clause for Unknown Type: #(struct:Error 23 #f)

This is definitely a bug in Typed Scheme.  I'll try to fix it soon.

The rest of your problem is that there's no predicate for a list of
some element type, and no way to write one at the moment.  I have
ideas on how to allow this, but they aren't done yet.

Right now, the only way to get a list of type A from a list of type B
is `filter':

(filter A? listofb) : (Listof A)

sam th
samth at ccs.neu.edu

Posted on the users mailing list.