Re: Type Inference type variables

2 views
Skip to first unread message

Jay McCarthy

unread,
Nov 30, 2010, 6:37:13 PM11/30/10
to Kevin Black, j...@cs.byu.edu, CS 330 mailing list
I would do exactly what you are proposing

Jay

Sent from my iPhone

On Nov 30, 2010, at 4:23 PM, Kevin Black <kevinb...@gmail.com> wrote:

> Are there rules for when to introduce type variables?
>
> Looking at the expression (cons x (f (f y))) in the program
> in 3.20.2 I am inclined to introduce a type variable alpha
> for x and a type variable beta for y.
>
> However, wouldn't it work just as well to refer to the type
> of x as [x] and for the type of y as [y] and not even use
> type variables alpha and beta? That would of course mean
> that the final answer wouldn't have the variables alpha and
> beta that are conventional for typing polymorphic functions.

Reply all
Reply to author
Forward
0 new messages