[MLton-user] Mutual recursion?

Adam Chlipala adamc at hcoop.net
Mon Jun 29 15:43:38 PDT 2009


Wesley W. Terpstra wrote:
> On Mon, Jun 29, 2009 at 10:49 PM, Andreas
> Rossberg<rossberg at mpi-sws.mpg.de> wrote:
>   
>>> Could someone perhaps explain to me why switching 'fun' for 'and' can
>>> lead to problems?
>>>       
>> No, a recursive reference is not polymorphic -- because type inference is
>> generally undecidable for polymorphic recursion.
>>     
>
> I see. I imagine that if I provide an explicit (polymorphic) type
> binding for each function, SML will be happy?
>   

I don't think so.  No matter how much annotation you add, you can't 
implement polymorphic recursion.  A function is only allowed to specify 
type parameters for functions defined in earlier declarations.



More information about the MLton-user mailing list