Aleksey Uymanov | 10 Aug 19:13 2013
Picon

Value-weak hash tables in Haskell ?

Hello, haskellers.

Is there any package implementing magic hash tables weak in value? I
mean when the value is garbage collected, then this key+value
authomatically removes from the hash table.

--

-- 
Aleksey Uymanov <s9gf4ult <at> gmail.com>
Erik Hesselink | 10 Aug 21:08 2013
Picon

Re: Value-weak hash tables in Haskell ?

I'm not sure, but there are weak pointer [0], though I have never used them.

Erik

[0] http://www.haskell.org/ghc/docs/latest/html/libraries/base/System-Mem-Weak.html

On Sat, Aug 10, 2013 at 7:13 PM, Aleksey Uymanov <s9gf4ult <at> gmail.com> wrote:
> Hello, haskellers.
>
> Is there any package implementing magic hash tables weak in value? I
> mean when the value is garbage collected, then this key+value
> authomatically removes from the hash table.
>
> --
> Aleksey Uymanov <s9gf4ult <at> gmail.com>
>
> _______________________________________________
> Haskell-Cafe mailing list
> Haskell-Cafe <at> haskell.org
> http://www.haskell.org/mailman/listinfo/haskell-cafe
Alessandro Vermeulen | 10 Aug 22:03 2013
Picon

Re: Value-weak hash tables in Haskell ?

There is supposed to be some weak hash map implementation somewhere.

However, if you can't find it you can easily create it yourself. However, you will need to use the map in IO so I suggest that you use the hashtables[1] package in combination with the weak pointers mentioned by Erik.

- Alessandro


On 10 aug. 2013, at 21:08, Erik Hesselink <hesselink <at> gmail.com> wrote:

I'm not sure, but there are weak pointer [0], though I have never used them.

Erik

[0] http://www.haskell.org/ghc/docs/latest/html/libraries/base/System-Mem-Weak.html

On Sat, Aug 10, 2013 at 7:13 PM, Aleksey Uymanov <s9gf4ult <at> gmail.com> wrote:
Hello, haskellers.

Is there any package implementing magic hash tables weak in value? I
mean when the value is garbage collected, then this key+value
authomatically removes from the hash table.

--
Aleksey Uymanov <s9gf4ult <at> gmail.com>

_______________________________________________
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
_______________________________________________
Haskell-Cafe mailing list
Haskell-Cafe <at> haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe
Trevor L. McDonell | 11 Aug 07:14 2013
Picon
Picon

Re: Value-weak hash tables in Haskell ?

This paper explains how to implement them and gives example code:



I'm not aware of a package that does it for you, but I implemented one as part of my own work so that may be able to provide another example.


Cheers,
-Trev


On 11/08/2013, at 6:03 AM, Alessandro Vermeulen <a.vermeulen <at> students.uu.nl> wrote:

There is supposed to be some weak hash map implementation somewhere.

However, if you can't find it you can easily create it yourself. However, you will need to use the map in IO so I suggest that you use the hashtables[1] package in combination with the weak pointers mentioned by Erik.

- Alessandro


On 10 aug. 2013, at 21:08, Erik Hesselink <hesselink <at> gmail.com> wrote:

I'm not sure, but there are weak pointer [0], though I have never used them.

Erik

[0] http://www.haskell.org/ghc/docs/latest/html/libraries/base/System-Mem-Weak.html

On Sat, Aug 10, 2013 at 7:13 PM, Aleksey Uymanov <s9gf4ult <at> gmail.com> wrote:
Hello, haskellers.

Is there any package implementing magic hash tables weak in value? I
mean when the value is garbage collected, then this key+value
authomatically removes from the hash table.

--
Aleksey Uymanov <s9gf4ult <at> gmail.com>

_______________________________________________
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
_______________________________________________
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

Gmane