[Haskell-beginners] Learning Haskell with the help of trees
Bob Ippolito
bob at redivi.com
Sat May 10 15:27:10 UTC 2014
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 at 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 at haskell.org
> http://www.haskell.org/mailman/listinfo/beginners
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.haskell.org/pipermail/beginners/attachments/20140510/5427d654/attachment.html>
More information about the Beginners
mailing list