[MLton] -warn-unused true and MLton

Stephen Weeks MLton@mlton.org
Wed, 18 Feb 2004 05:29:16 -0800


> I've been changing:
> 
> (f x; ()) ==> ignore (f x)
> 
> (f x; e) ==> let val _ = f x
>              in e
>              end
> 
> (f x; g y; ()) ==> let val _ = f x
>                        val _ = g y
>                    in ()
>                    end

I was thinking it would be nice to use "val () = ..." instead of "val
_ = ..." when the return type is unit.  I've long wanted to use that
idiom, but had avoided it because it caused SML/NJ to give a warning
about no variables in pattern or something like that.  I just checked
SML/NJ 110.44 and it no longer gives that warning.  So, I'd be happy
to start seeing "val () = ...", and plan to try it myself.