
On Sun, Dec 4, 2011 at 18:40, Felipe Almeida Lessa
On Sun, Dec 4, 2011 at 3:30 PM, Erik Hesselink
wrote: It's not just type families though, right? I mean, a (Map A) cannot be coerced to a (Map B), even if B is a newtype over A, since they might have different Ord instances, and thus a different map structure.
It depends on what you call "safe". The bug Brent Yorgey was referring to allows you to get sefaults and the like. The bug you're describing violates some invariants, but these invariants are not expressed in the type system and won't make a hard crash of your program.
Ah, you are right of course. The Ord case is the same as having a hidden constructor, and a partial construction function which verifies some invariant. As you mention, the type family case is substantially different. Erik