[Haskell-cafe] Transactional container for storing anonymous deletable objects

John Ky newhoggy at gmail.com
Sun Dec 28 19:46:57 EST 2008


I need a container data structure for storing anonymous objects - most
likely things that have not value such as STM (), but probably other things
as well.  This will allow me to later on, iterate over the container and
process those objects.  Additionally I have the requirement that I need to
be able to remove individual objects from this container.  It needs to be
linear time.

main = do
   container <- nil
   key1 <- cons 1 container
   key2 <- cons 2 container
   key3 <- cons 3 container
   key4 <- cons 4 container
   key5 <- cons 5 container
   unlink key3 container
   unlink key2 container
   unlink key4 container
   list <- toList container
   putStrLn (show list)

The above should give: [1, 5]

What should I use?


-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.haskell.org/pipermail/haskell-cafe/attachments/20081229/6c62b0ff/attachment.htm

More information about the Haskell-Cafe mailing list