[MLton] building mlton on Snow Leopard

Matthew Fluet mtf at cs.rit.edu
Thu Sep 17 08:35:34 PDT 2009


val { get : Var.t -> ((WordSize.t
                        * WordSize.t
                        * {signed:bool})
                       * Var.t) option,
       set, ... } =
    Property.getSetOnce (Var.plist, Property.initConst NONE)

Committed as r7229.

On Thu, 17 Sep 2009, John Reppy wrote:
> I understand the source of the error, but what is the correct type here so 
> that I can
> fix it?  A debate about the interpretation of the SML'97 semantics is not 
> useful (even
> though I actually agree with your position).
>
> 	- John
>
> On Sep 17, 2009, at 10:16 AM, Matthew Fluet wrote:
>
>> On Thu, 17 Sep 2009, John Reppy wrote:
>>> I'm trying to compile mlton (revision 7228) using the command
>>>
>>> 	make TARGET_ARCH=x86_64 smlnj-mlton
>>> 
>>> on Snow Leopard, but I'm hitting type errors in 
>>> ssa/combine-conversions.fun
>> 
>> Nothing to do with Snow Leopard.  Everything to do with SML/NJ using an 
>> overly restrictive context for type inference.
>> 
>>> ssa/combine-conversions.fun:57.5-58.60 Warning: type vars not generalized 
>>> because of value restriction are instantiated to dummy types (X1,X2,...)
>> 
>> The code in question is:
>> 
>> val { get, set, ... } =
>>  Property.getSetOnce (Var.plist, Property.initConst NONE)
>> 
>> Yes, the type of NONE (and get and set) are undetermined by this 
>> declaration.  However, subsequent use of get and set within the module 
>> determine the types.
>> 
>> For a smaller example:
>> 
>> structure S =
>> struct
>>  val z = (fn x => x) []
>>  val y = z :: [true] :: nil
>> end
>> 
>> Accepted by MLton, Poly/ML, and HaMLet; only rejected by SML/NJ.
>> 
>> Another example:
>> 
>> structure S : sig val z : bool list end =
>> struct
>>  val z = (fn x => x) []
>> end
>> 
>> Accepted by MLton, Poly/ML, and HaMLet; only rejected by SML/NJ.
>> 
>> 
>> Admittedly, we have attempted to keep the MLton sources compatible with 
>> SML/NJ, so we will probably put in an explicit type constraint (you'll see 
>> such a constraint in most uses of Property.* functions), but it's really 
>> SML/NJ's bug.
>> 
>
>
> _______________________________________________
> MLton mailing list
> MLton at mlton.org
> http://mlton.org/mailman/listinfo/mlton

-- 
============================================
Matthew Fluet
Assistant Professor
Department of Computer Science
Rochester Institute of Technology
102 Lomb Memorial Drive
Rochester, NY 14623-5608
Tel: +1.585.475.2854 ; Fax: +1.585.475.4935
mtf at cs.rit.edu ; http://www.cs.rit.edu/~mtf
============================================
CONFIDENTIALITY NOTE: The information transmitted, including attachments,
is intended only for the person(s) or entity to which it is addressed and
may contain confidential and/or privileged material.  Any review,
retransmission, dissemination or other use of, or taking of any action in
reliance upon this information by persons or entities other than the
intended recipient is prohibited.  If you received this in error, please
contact the sender (mtf at cs.rit.edu) and destroy any copies of this
information.



More information about the MLton mailing list