Minor containers API changes

Felipe Almeida Lessa felipe.lessa at gmail.com
Sun Dec 4 14:06:36 CET 2011


On Sun, Dec 4, 2011 at 3:52 AM, Edward Z. Yang <ezyang at mit.edu> wrote:
> Excerpts from Felipe Almeida Lessa's message of Wed Nov 30 07:51:20 -0500 2011:
>>   reverse' :: Map (Reverse k) a -> Map k a
>>   reverse' = unsafeCoerce . reverse
>>
>> Sorry, couldn't resist =).
>
> I might be confused, but doesn't this break internal invariants in Map?

Which ones?  The Ord instance of 'Reverse (Reverse k)'s should be the
same as that of 'k', right?  Other than that, what invariants could be
broken?

Cheers,

-- 
Felipe.



More information about the Libraries mailing list