I&#39;m not exactly sure what you mean by preserve order, but no, Doubles would not behave as expected in an EnumMap because fromEnum for Doubles just truncates:<br>fromEnum (2.0 :: Double) == 2<br>fromEnum (2.5 :: Double) == 2<br>
<br>However I think that is more an issue with the Enum instances than with EnumMap.<br>I really don&#39;t think Double should be an instance of Enum. (or if it is, it should actually _enumerate_ the values)<br>It&#39;s basically just there for the list comprehension syntax.<br>
take 5 [1.0 ..] :: [Double] == [1.0,2.0,3.0,4.0,5.0]<br>But I feel like that would be better handled with Num instances or something, or with a separate typeclass.<br><br>- Job<br><br><div class="gmail_quote">On Mon, Aug 10, 2009 at 1:37 PM, Louis Wasserman <span dir="ltr">&lt;<a href="mailto:wasserman.louis@gmail.com">wasserman.louis@gmail.com</a>&gt;</span> wrote:<br>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">Pardon my asking, but are fromEnum and toEnum guaranteed to preserve order on types like Double?  I&#39;d like to see a Double-backed Patricia tree map, but are we certain that EnumMap as presented will behave properly on such types?<br>


<br clear="all">Louis Wasserman<br><font color="#888888"><a href="mailto:wasserman.louis@gmail.com" target="_blank">wasserman.louis@gmail.com</a><br>
</font><br>_______________________________________________<br>
Haskell-Cafe mailing list<br>
<a href="mailto:Haskell-Cafe@haskell.org">Haskell-Cafe@haskell.org</a><br>
<a href="http://www.haskell.org/mailman/listinfo/haskell-cafe" target="_blank">http://www.haskell.org/mailman/listinfo/haskell-cafe</a><br>
<br></blockquote></div><br>