Assignment 10.2 is unclear

Moderator: Type Systems of Programming Languages

dschneid
Sonntagsinformatiker
Sonntagsinformatiker
Beiträge: 271
Registriert: 14. Dez 2009 00:56

Assignment 10.2 is unclear

Beitrag von dschneid »

Hi,

unfortunately, the second task of the current assignment is completely unclear to me. There are two problems: Firstly, I am unable to see how the universal types are used. Secondly, I can't imagine how exactly the constraint system is built. Currently, we only see a type rule which merely propagates constraints. That doesn't really give you much insight.

All in all, I'm having some trouble relating the language from this task to System F and to what we did in the lecture. In particular, I don't understand why it is called let polymorphic, which seems to imply that the focus regarding universal types is somehow on the let. I think we mentioned this somehow in the lecture, but apparently the essential information somehow got buried for me in all of that Scala code.

I've been trying to get some more information from the book, but that wasn't particularly successful. It would be extremely helpful if more type rules could be provided.

Thanks.

erdweg
Moderator
Moderator
Beiträge: 60
Registriert: 28. Mär 2013 10:08

Re: Assignment 10.2 is unclear

Beitrag von erdweg »

Hi,

the shown type rule only illustrates one way of writing them. It is a mere repetition from the lecture, nothing new. All type rules for type inference appear in the book in Figure 22-1, page 322 in my edition.
In particular, I don't understand why it is called let polymorphic, which seems to imply that the focus regarding universal types is somehow on the let. I think we mentioned this somehow in the lecture, but apparently the essential information somehow got buried for me in all of that Scala code.
It is called let-polymorphic, because universal type are only inferred for let-bound variables. You can look up "let-polymorphism" in the index of Pierce's book. In addition, you might find the examples of the suite helpful that we used during the lecture.

Cheers,
Sebastian

Antworten

Zurück zu „Type Systems of Programming Languages“