Hi,
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?
Thanks
-John