Article View: comp.lang.functional
Article #741Re: Type Inference in ML (LML, actually)
From: Friendless
Date: Thu, 17 Jan 1991 06:53
Date: Thu, 17 Jan 1991 06:53
14 lines
1180 bytes
1180 bytes
In <3603@bruce.cs.monash.OZ.AU> mmcg@bruce.cs.monash.OZ.AU (Mike McGaughey) writes: > let x = hd o hd in x >will typecheck properly - to (List (List *a))->*a) - whereas > (\x.x o x) hd >will not. The problem with the second expression seems to be that the >inference algorithm erroneously expects both of the 'x' values in the >x o x to have the same type signature, This is the correct behaviour of Milner typing - parameters only have one type. I was surprised too when I found it out, but I think it complicates the algorithm a lot to fix it. Friendless
Technical Details
Message-ID:
<6809@uqcspe.cs.uq.oz.au>Path:
arc1-ca.pugleaf.net!utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!swrinde!elroy.jpl.nasa.gov!sdd.hp.com!wuarchive!rex!ames!uhccux!munnari.oz.au!brolga!uqcspe!batserver.cs.uq.oz.au!farrellReferences:
<54161@eerie.acsu.Buffalo.EDU> <4353@undis.cs.chalmers.se> <6784@uqcspe.cs.uq.oz.au> <3603@bruce.cs.monash.OZ.AU>Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!swrinde!elroy.jpl.nasa.gov!sdd.hp.com!wuarchive!rex!ames!uhccux!munnari.oz.au!brolga!uqcspe!batserver.cs.uq.oz.au!farrell From: farrell@batserver.cs.uq.oz.au (Friendless) Newsgroups: comp.lang.functional Subject: Re: Type Inference in ML (LML, actually) Message-ID: <6809@uqcspe.cs.uq.oz.au> Date: 17 Jan 91 06:53:38 GMT References: <54161@eerie.acsu.Buffalo.EDU> <4353@undis.cs.chalmers.se> <6784@uqcspe.cs.uq.oz.au> <3603@bruce.cs.monash.OZ.AU> Sender: news@uqcspe.cs.uq.oz.au Reply-To: farrell@batserver.cs.uq.oz.au Lines: 14