[Haskell-cafe] Where is SNMap for stable names?
Edward Kmett
ekmett at gmail.com
Sat Sep 24 01:44:00 CEST 2011
I use hashStableName to split the names up then walk down the list use equality comparisons on an expected O(1) items. I'll probably rewrite it using unordered containers, since Tibbe does the same sans the stable names.
Sent from my iPad
On Sep 23, 2011, at 5:54 AM, "Alberto G. Corona " <agocorona at gmail.com> wrote:
> How do you do that, since Stable Names have not an Ord instance?. Using the Eq instance the lookup should be O(n).
>
> The paper suggest that SNMap is a hash table, presumably with hashStableNames underneath:
>
> This should work more or less . using Data.HashTable
>
> Import Data.HashTable
> import Data.Dynamic
>
> table :: HashTable StableName Dynamic
>
> table= new (==) hashStableName
>
>
>
>
> 2011/9/22 Edward Kmett <ekmett at gmail.com>
> I have a "stable-maps" package that provides lookup and inserting into a map via stable names.
>
> -Edward
>
> On Thu, Sep 22, 2011 at 5:47 AM, Sean Leather <leather at cs.uu.nl> wrote:
> There is an abstract type called SNMap for stable names referred to in [1]. This has apparently disappeared from GHC a long time ago. Is it still available somewhere, or is there a suitable replacement for it?
>
> Regards,
> Sean
>
> [1] "Stretching the storage manager: weak pointers and stable names in Haskell" - http://research.microsoft.com/apps/pubs/default.aspx?id=67497
>
> _______________________________________________
> Haskell-Cafe mailing list
> Haskell-Cafe at haskell.org
> http://www.haskell.org/mailman/listinfo/haskell-cafe
>
>
>
> _______________________________________________
> Haskell-Cafe mailing list
> Haskell-Cafe at haskell.org
> http://www.haskell.org/mailman/listinfo/haskell-cafe
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.haskell.org/pipermail/haskell-cafe/attachments/20110923/49344279/attachment.htm>
More information about the Haskell-Cafe
mailing list