tag:blogger.com,1999:blog-5888658295182480819.post303285116941500351..comments2022-04-05T09:43:19.308-03:00Comments on Alaska Ataca a Kamtchatka: The limits of Hindley-MilnerMatías Giovanninihttp://www.blogger.com/profile/17772004856076119446noreply@blogger.comBlogger4125tag:blogger.com,1999:blog-5888658295182480819.post-41731159178358259282009-01-08T11:10:00.000-02:002009-01-08T11:10:00.000-02:00Hello, it seems no way to do what you want. I'm no...Hello, it seems no way to do what you want. I'm not able to find original discussion, but some results are summarised at<BR/>http://www.petitepomme.net/~schmitta/alan/cwn/2004.12.14.html#3ssphttps://www.blogger.com/profile/07663047733495384691noreply@blogger.comtag:blogger.com,1999:blog-5888658295182480819.post-58354320463288117152009-01-08T05:49:00.000-02:002009-01-08T05:49:00.000-02:00I thought that byval thread : ('a . 'a -&g...I thought that by<BR/><BR/>val thread : ('a . 'a -> 'a -> 'a) -> 'a * 'b -> 'a * 'b -> 'a * 'b<BR/><BR/>you actually meant that the first argument had to be polymorphic.<BR/><BR/>Parametricity does not imply that the type binop is empty. Pure and total functions in this type are (fun x y -> x), (fun x y -> y). But in OCaml, you have Alain Frischhttps://www.blogger.com/profile/10817801021529423292noreply@blogger.comtag:blogger.com,1999:blog-5888658295182480819.post-52636346733889359752009-01-08T00:59:00.000-02:002009-01-08T00:59:00.000-02:00Alain,I tried that, but I stumbled trying to actua...Alain,<BR/><BR/>I tried that, but I stumbled trying to actually build such a binop. I understand that the type of the label apply means "this is a value that, for all 'a, takes an 'a and an 'a and returns an 'a". As far as I can see parametricity dictates that the type is empty. It is here where I think, what am I missing?Matías Giovanninihttps://www.blogger.com/profile/17772004856076119446noreply@blogger.comtag:blogger.com,1999:blog-5888658295182480819.post-78991912033918375042009-01-07T20:24:00.000-02:002009-01-07T20:24:00.000-02:00Yes, polymorphic record fields give you such first...Yes, polymorphic record fields give you such first-class polymorphism:<BR/><BR/>type binop = { apply: 'a. 'a -> 'a -> 'a }<BR/><BR/>let thread f (a, x) (b, y) = (f.apply a b, f.apply x y)Alain Frischhttps://www.blogger.com/profile/10817801021529423292noreply@blogger.com