[MLton] Error Messages for Missing Sharing/Where Type
Steven Melendez
smelendez@gmail.com
Fri, 30 Jun 2006 15:58:26 -0400
------=_Part_34406_11535783.1151697506946
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
Content-Disposition: inline
Sure,
The basic idea is that if you go to compile, say,
signature A =
sig
type a
val function : a -> a
val var : a
end
functor simple (structure A1 : A, structure A2 : A) =
struct
val _ = A1.function (A2.var)
end
it will give a message saying that A1.a, A2.a cannot be unified as usual,
but
will also say something like "Both A1.a and A2.a are flexible type
constructors: are you missing a sharing constraint?"
But if, say, function were of type a -> a, and var were of type string, it
would just give the usual error that the types could not be unified.
On 6/30/06, Stephen Weeks <sweeks@sweeks.com> wrote:
>
>
> > I was hoping to give "suggestions" for missing sharing constraints
> > or "where type.." declarations.
>
> Could you send a few examples, each showing a type incorrect program
> and the error message you would like to produce?
>
> _______________________________________________
> MLton mailing list
> MLton@mlton.org
> http://mlton.org/mailman/listinfo/mlton
>
------=_Part_34406_11535783.1151697506946
Content-Type: text/html; charset=ISO-8859-1
Content-Transfer-Encoding: 7bit
Content-Disposition: inline
Sure,<br>
<br>
The basic idea is that if you go to compile, say,<br>
<br>
signature A =<br>
sig<br>
type a<br>
val function : a -> a<br>
val var : a<br>
end<br>
<br>
functor simple (structure A1 : A, structure A2 : A) =<br>
struct<br>
val _ = A1.function (A2.var)<br>
end<br>
<br>
it will give a message saying that A1.a, A2.a cannot be unified as usual, but<br>
will also say something like "Both A1.a and A2.a are flexible type constructors: are you missing a sharing constraint?"<br>
<br>
But if, say, function were of type a -> a, and var were of type
string, it would just give the usual error that the types could not be
unified.<br>
<br>
<br><br><div><span class="gmail_quote">On 6/30/06, <b class="gmail_sendername">Stephen Weeks</b> <<a href="mailto:sweeks@sweeks.com">sweeks@sweeks.com</a>> wrote:</span><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<br>> I was hoping to give "suggestions" for missing sharing constraints<br>> or "where type.." declarations.<br><br>Could you send a few examples, each showing a type incorrect program<br>and the error message you would like to produce?
<br><br>_______________________________________________<br>MLton mailing list<br><a href="mailto:MLton@mlton.org">MLton@mlton.org</a><br><a href="http://mlton.org/mailman/listinfo/mlton">http://mlton.org/mailman/listinfo/mlton
</a><br></blockquote></div><br>
------=_Part_34406_11535783.1151697506946--