unique identifiers as a separate library

Sebastian Fischer sebf at informatik.uni-kiel.de
Mon Dec 22 06:27:40 EST 2008

Thanks for pointing me at Iavors package. We should not have two  
different libraries for the same purpose.

value-supply-0.2 is about 6-7 times slower than GHC's UniqSupply, but  
porting Simons suggestion (to use unsafeDupableInterleaveIO) into  
Iavors code, GHC is "only" about twice as fast.

Can we do better? I tried to use SPECIALIZE INLINE pragmas (at  
new[Enum|Num]Supply for Int) and/or strictness annotations (for the  
unique value) without significant benefit.

I like Iavors more general interface (polymorphic values) and that  
only demanded identifiers are created. The latter saves half of the  
names when evaluating

 > map supplyValue . split

I will replace my dependency to ghc with one to value-supply if  
unsafeDupableInterleaveIO is used instead of unsafeInterleaveIO where  
it is available.


More information about the Glasgow-haskell-users mailing list