[MLton-user] doc update
Matthew Fluet
fluet at tti-c.org
Thu Nov 22 07:22:44 PST 2007
On Thu, 22 Nov 2007, Sean McLaughlin wrote:
> Oh, I'm sorry! I got the syntax wrong. I was using "error" instead
> of "default"
Yes, the 'nonexhaustiveExnMatch' annotation is somewhat different from the
others, as it just refines the behavior of the 'nonexhaustiveMatch'
annoation. Furthermore, 'nonexhaustiveExnMatch' only affects the
treatment of non-handle matches that have exceptions. Vesa introduced the
annotation, and I believe the motivation was for the situations where one
is using the exn type as an extensible type of variants and one might have
something like:
exception Good
exception Bad
val toBool = fn Good => true
| Bad => false
where the nonexhaustive match warning on the toBool function is unwanted
noise.
> On Nov 21, 2007 3:14 PM, Matthew Fluet <fluet at tti-c.org> wrote:
>> On Wed, 21 Nov 2007, Sean McLaughlin wrote:
>>> It appears the documentation on annotations is out of date. There is no
>>> longer a nonexhaustiveExnMatch.
>>
>> Can you be more specific? It works fine for me:
>>
>> [fluet at wolfpup tmp]$ cat z.mlb
>> $(SML_LIB)/basis/basis.mlb
>> ann "nonexhaustiveExnMatch ignore" in
>> z.sml
>> end
>> [fluet at wolfpup tmp]$ mlton
>> MLton 20070826 (built Wed Aug 29 09:44:07 2007 on silver-star.cs.uchicago.edu)
>> [fluet at wolfpup tmp]$ mlton z.mlb
>>
>>
>>
>
> _______________________________________________
> MLton-user mailing list
> MLton-user at mlton.org
> http://mlton.org/mailman/listinfo/mlton-user
>
More information about the MLton-user
mailing list