[racket-dev] typed/scheme n00b question

From: Hari Prashanth (krhari at ccs.neu.edu)
Date: Sun Sep 5 03:30:16 EDT 2010

Sorry.. The return type should be (U Integer Void exn:fail:filesystem)


----- Original Message -----
From: "Hari Prashanth" <krhari at ccs.neu.edu>
To: "John Clements" <clements at brinckerhoff.org>
Cc: "plt-dev Developers" <dev at lists.racket-lang.org>
Sent: Sunday, September 5, 2010 3:06:49 AM GMT -05:00 US/Canada Eastern
Subject: Re: [racket-dev] typed/scheme n00b question

Is this what you are looking for? 

(require/typed racket/base
               [file-or-directory-modify-seconds 
                (String (Option Integer) (-> exn:fail:filesystem) -> (U Integer Void))])


Hari

----- Original Message -----
From: "John Clements" <clements at brinckerhoff.org>
To: "plt-dev Developers" <dev at lists.racket-lang.org>
Sent: Sunday, September 5, 2010 1:44:17 AM GMT -05:00 US/Canada Eastern
Subject: [racket-dev] typed/scheme n00b question

I'd like to write a typed/racket or typed/racket/base program that uses "file-or-directory-modify-seconds". I get this error:

Type Checker: untyped identifier file-or-directory-modify-seconds imported from module <typed/racket/base> in: file-or-directory-modify-seconds

If this function were acquired using a 'require', I see that I could use 'require/typed' to associate a type with it.  I don't see how to apply this to functions that come in as part of the language.

I tried various decorations to wrap the use of the function in checks, but then realized that the type checker wasn't complaining that the value had the 'Any' type, but instead that the value was untyped, which suggests that type-futzing (checking that it's a procedure, etc.) was unlikely to help.

What's the (presumably obvious?) solution to this?

John


_________________________________________________
  For list-related administrative tasks:
  http://lists.racket-lang.org/listinfo/dev
_________________________________________________
  For list-related administrative tasks:
  http://lists.racket-lang.org/listinfo/dev


Posted on the dev mailing list.