
4 Dec
2011
4 Dec
'11
8:06 a.m.
On Sun, Dec 4, 2011 at 3:52 AM, Edward Z. Yang
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.