
3 Jul
2010
3 Jul
'10
7:10 p.m.
>> I cannot directly create my own class instances for them because of >> that. But I found that I can write Template Haskell code that could do >> that - those data types could be reified just fine. > Huh? Sure you can write class instances for them. > ,---- > | instance SizeOf (Map k v) where > | sizeOf = Map.size > `---- Those are trivial. They are not interesting. I cannot write classes that see into internal structure. For example, I cannot write my own (de)serialization without using from/toAscList. >> This is somewhat strange situation. >> Was it a design decision? > The reason that they are exported abstractly is so that you don't see > the internals of the data structure, because 1) you don't need to, and > 2) to stop you from doing anything stupid with them. I was talking about successful reification of abstract data types. That way I can do anything stupid with them. At least, it looks like I can, I didn't tried, actually.