Re: [racket-users] unexpected behavior of parametric polymorphism in Typed Racket

2017-11-28 Thread Daniel Feltey
Sorry for the late reply to this thread, I tried to send this message yesterday, but ran into problems with my email setup. > I'm starting to think that my base assumption (that Typed Units are more or > less equivalent to ML signatures, structures, and functors) is way off. The intent is that

Re: [racket-users] unexpected behavior of parametric polymorphism in Typed Racket

2017-11-28 Thread Matthias Felleisen
> On Nov 28, 2017, at 10:02 AM, Richard Cobbe wrote: > > On Tue, Nov 28, 2017 at 09:43:54AM -0500, Matthias Felleisen wrote: >> >> I have forwarded your email to Daniel Felty who designed and implemented the >> typed units. I am hoping to get a response soon — Matthias > >

Re: [racket-users] unexpected behavior of parametric polymorphism in Typed Racket

2017-11-28 Thread Richard Cobbe
On Tue, Nov 28, 2017 at 09:43:54AM -0500, Matthias Felleisen wrote: > > I have forwarded your email to Daniel Felty who designed and implemented the > typed units. I am hoping to get a response soon — Matthias Great, thanks. > > On Nov 26, 2017, at 6:11 PM, Richard Cobbe

Re: [racket-users] unexpected behavior of parametric polymorphism in Typed Racket

2017-11-28 Thread Matthias Felleisen
I have forwarded your email to Daniel Felty who designed and implemented the typed units. I am hoping to get a response soon — Matthias > On Nov 26, 2017, at 6:11 PM, Richard Cobbe wrote: > > Returning to this after a long delay... > > On Sat, Nov 11, 2017 at 01:34:05PM

Re: [racket-users] unexpected behavior of parametric polymorphism in Typed Racket

2017-11-26 Thread Richard Cobbe
Returning to this after a long delay... On Sat, Nov 11, 2017 at 01:34:05PM -0500, Matthias Felleisen wrote: > > (Context: I only actually intend to use `store' with a single type, but I > > want to define that type in a separate module. Since the type's definition > > refers to `addr', I made

Re: [racket-users] unexpected behavior of parametric polymorphism in Typed Racket

2017-11-11 Thread Matthias Felleisen
Couldn’t Richard solve his second problem with the supply of a single type parameter to both new and alloc: #lang typed/racket (define-type Addr Natural) (define-type (Store α) (Listof α)) (: make-store (All (α) (-> (Values [-> (Store α)] [(Store α) α -> (Values (Store α) Addr)] (define

Re: [racket-users] unexpected behavior of parametric polymorphism in Typed Racket

2017-11-10 Thread Sam Tobin-Hochstadt
Your intuitions about both questions are right here. First, type variables are only introduced into scope automatically in the function body for function definitions. You can use `#:forall` with `define` to use polymorphic types inline, but that does not allow you to define a polymorphic store