In order to implement delete you need to have some sort of merge operation for the cases where the node being deleted has more than one child. In this case your tree data structure doesn't appear to be a search tree or balanced in any way so it's much harder to generally decide how delete should work.


On Sat, May 10, 2014 at 5:05 AM, Michal Kawalec <michal@bazzle.me> wrote:
Hi,

I am beginning to learn Haskell, and I decided to try to implement a
tree. Its code is available at
https://gist.github.com/anonymous/dd3eaa8bc36025d7751c

I would need some help with implementing the delete element procedure. I
have a feeling I am doing something very unhaskelly there. Also, when
deleting a node having two children, how do I run two actions (swap the
values and delete the successor)?

Also, I would be delighted if you could take a look on the style and
similar aspects, as they are best addressed at the beginning.



Thanks,
Michal


_______________________________________________
Beginners mailing list
Beginners@haskell.org
http://www.haskell.org/mailman/listinfo/beginners