On Dec 17, 2008, at 10:54 AM, Sebastian Fischer wrote:

Would it be possible to put everything concerned with unique identifiers in GHC into a separate package on Hackage?


I have wrapped up (a tiny subset of) GHC's uniques into the package `uniqueid` and put it on Hackage:

    http://hackage.haskell.org/cgi-bin/hackage-scripts/package/uniqueid

It only provides

    type Id
    hashedId :: Id -> Int

    type IdSupply
    initIdSupply  :: Char -> IO IdSupply
    splitIdSupply :: IdSupply -> (IdSupply,IdSupply)
    idFromSupply  :: IdSupply -> Id

    instance Eq Id
    instance Ord Id
    instance Show Id

The main difference is due to my fear of depending on the foreign function `genSymZh` which I replaced by a global counting IORef.

The other difference is that the Show instance does not rely on GHC's static flags and can hence be used outside of GHC sessions.

The code is on github:

    http://github.com/sebfisch/uniqueid

Extensions welcome!

Cheers,
Sebastian
_______________________________________________
Glasgow-haskell-users mailing list
Glasgow-haskell-users@haskell.org
http://www.haskell.org/mailman/listinfo/glasgow-haskell-users

Reply via email to