Re: equality types in SML Basis Library (fwd)
Matthew Fluet <[email protected]>
| Newsgroups | gmane.comp.lang.ml.mlton.user |
|---|---|
| Message-ID | <[email protected]> |
Some thoughts from John Reppy on the equality status of substrings, and mono vectors and slices. ---------- Forwarded message ---------- Date: Mon, 2 Dec 2013 17:08:50 -0600 From: John Reppy <[email protected]> To: Matthew Fluet <[email protected]> Subject: Re: equality types in SML Basis Library The following is based on memory, but I probably still have the email record somewhere. For slices, I think that that we decided that they should not be equality types because of the potentially surprising behavior of something like (Substring.substring("abc", 1, 1) = Substring.substring("xbz", 1, 1)) Substring.compare returns EQUAL on these, but if you call Substring.base, you get unequal results, so they are not structurally equal. For monomorphic vector types, I think that they should all be equality types, except for Real vectors (i.e., when their element type is an eqtype). All array types should be equality types (and the "array" type constructor should be treated like "ref"). - John On Dec 2, 2013, at 2:10 PM, Matthew Fluet <[email protected]> wrote: > Hi John, > > Henry was noticing some inconsistencies between MLton and the SML Basis > Library specification with respect to equality status of substrings, and > mono vector and vector slices: > > http://sourceforge.net/p/mlton/mailman/message/31662605/ > > Any thoughts? Was it intentional that the monomorphic vectors (other > than CharVector) do not have equality status? Similarly, was it > intentional that substrings do not have equality status? > > -Matthew To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. ------------------------------------------------------------------------------ Rapidly troubleshoot problems before they affect your business. Most IT organizations don't have a clear picture of how application performance affects their revenue. With AppDynamics, you get 100% visibility into your Java,.NET, & PHP application. Start your 15-day FREE TRIAL of AppDynamics Pro! http://pubads.g.doubleclick.net/gampad/clk?id=84349351&iu=/4140/ostg.clktrk