
1 Jan
2011
1 Jan
'11
7:38 a.m.
Thinking about this there might be one problem: Without having looked further into this I think perfomance might not be as expected. Using unsafePerformIO affects ghc's optimzations, doesn't it? So I wonder if it's a good idea (from a performance point of view) to use this.
2010/12/30 Andreas Baldeau
: instance Ord TypeRep where compare t1 t2 = compare (unsafePerformIO (typeRepKey t1)) (unsafePerformIO (typeRepKey t2))
typeRepKey :: TypeRep -> IO Int typeRepKey (TypeRep (Key i) _ _) = return i
So the question is, if ghc could transform this to simply compare the keys throwing away unsafePerformIO and return.