Re: [racket] An error with dates and types

2011-08-22 Thread Sam Tobin-Hochstadt
On Mon, Aug 22, 2011 at 7:32 AM, Sam Tobin-Hochstadt wrote: > On Sun, Aug 21, 2011 at 9:40 PM, Norman Gray wrote: >>  date->seconds has a sort of core-ish feel." > > That's correct.  There are two problems here: first, `date->seconds' > is missing a type, along with most of the rest of the `racke

Re: [racket] An error with dates and types

2011-08-22 Thread Sam Tobin-Hochstadt
On Sun, Aug 21, 2011 at 11:06 AM, Norman Gray wrote: > (Is the list generally OK for straight bug reports?  There isn't a bug parade > I should be posting this on, is there?) For things that are definitely bugs like this, you can report them using "Submit Bug Report" in the Help menu in DrRacket

Re: [racket] An error with dates and types

2011-08-22 Thread Sam Tobin-Hochstadt
On Sun, Aug 21, 2011 at 9:40 PM, Norman Gray wrote: >  date->seconds has a sort of core-ish feel." That's correct. There are two problems here: first, `date->seconds' is missing a type, along with most of the rest of the `racket/date' library. Second, there's a bug in Typed Racket that causes t

Re: [racket] An error with dates and types

2011-08-21 Thread Norman Gray
On 2011 Aug 22, at 01:30, Carl Eastlund wrote: >> I wrote so. That's why I believe that the existing TR confused Norman into >> requiring date->seconds from an UNTYPED >> module. I really think we need require:. > > There might be some confusion here because there are two kinds of > typed modu

Re: [racket] An error with dates and types

2011-08-21 Thread Carl Eastlund
On Sun, Aug 21, 2011 at 8:22 PM, Matthias Felleisen wrote: > > On Aug 21, 2011, at 8:15 PM, Carl Eastlund wrote: > >> You can't.  You can require stuff from *typed* modules. > > I wrote so. That's why I believe that the existing TR confused Norman into > requiring date->seconds from an UNTYPED >

Re: [racket] An error with dates and types

2011-08-21 Thread Matthias Felleisen
On Aug 21, 2011, at 8:15 PM, Carl Eastlund wrote: > You can't. You can require stuff from *typed* modules. I wrote so. That's why I believe that the existing TR confused Norman into requiring date->seconds from an UNTYPED module. I really think we need require:.

Re: [racket] An error with dates and types

2011-08-21 Thread Carl Eastlund
On Sun, Aug 21, 2011 at 5:20 PM, Matthias Felleisen wrote: > > The way I understand the word "ought" comes with a moral connotation. > In this sense, I am saying > > (1) require should not exist in TR > > (2) require: should exist for importing from typed modules > > (3) require-typed should exist

Re: [racket] An error with dates and types

2011-08-21 Thread Matthias Felleisen
That's another good idea: translate provide/contract specs into types. On Aug 21, 2011, at 6:16 PM, Robby Findler wrote: > Perhaps it would be nice to have require exist in TR but for it to > collaborate with provide/contract to turn the parts of the contracts > that it can into types (and le

Re: [racket] An error with dates and types

2011-08-21 Thread Robby Findler
Perhaps it would be nice to have require exist in TR but for it to collaborate with provide/contract to turn the parts of the contracts that it can into types (and leave behind some contract checking) and, when you or Ryan or someone figures out how macros & contracts work together, to fit those in

Re: [racket] An error with dates and types

2011-08-21 Thread Matthias Felleisen
The way I understand the word "ought" comes with a moral connotation. In this sense, I am saying (1) require should not exist in TR (2) require: should exist for importing from typed modules (3) require-typed should exist for importing from untyped modules. Why? The idea of explicit speci

Re: [racket] An error with dates and types

2011-08-21 Thread Norman Gray
Greetings. On 2011 Aug 21, at 18:38, Carl Eastlund wrote: > The error > Norman reported looks like an internal error in TR related to the > contract on date->seconds. This was my impression. Sorry if it wasn't clear, but my intention was to report the occurrence of the internal-looking error.

Re: [racket] An error with dates and types

2011-08-21 Thread Carl Eastlund
I still don't follow. There's a shallow error -- 'ought' means the same as 'should', presumably you mean to remove 'be able to' instead. But there's also a deeper error, as far as I can tell. In general, one should use require rather than require/typed so you use a binding's originally assigned t

Re: [racket] An error with dates and types

2011-08-21 Thread Matthias Felleisen
I should have used 'ought' instead of 'should'. On Aug 21, 2011, at 1:38 PM, Carl Eastlund wrote: > Plain require works fine in Typed Racket; there's only a problem if TR > cannot typecheck the resulting code. You normally only need to use > require/typed to assign types to otherwise-unty

Re: [racket] An error with dates and types

2011-08-21 Thread Carl Eastlund
Plain require works fine in Typed Racket; there's only a problem if TR cannot typecheck the resulting code. You normally only need to use require/typed to assign types to otherwise-untyped imports. The error Norman reported looks like an internal error in TR related to the contract on date->secon

Re: [racket] An error with dates and types

2011-08-21 Thread Matthias Felleisen
You shouldn't be able to use plain require in Typed Racket. Try this: #lang typed/racket (require/typed racket/date (date->seconds (date -> Natural))) (date->seconds (seconds->date (current-seconds))) On Aug 21, 2011, at 11:06 AM, Norman Gray wrote: > > Greetings. > > Another typed-racket