From aba0c1d0b1b07e8d54db287623ea9dfc65c124e6 Mon Sep 17 00:00:00 2001 From: Aaro Koivukangas Date: Wed, 24 Dec 2025 13:23:18 +0200 Subject: [PATCH] 5b ex6 --- exercises/Set5b.hs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/exercises/Set5b.hs b/exercises/Set5b.hs index f36cacd..a1e0063 100644 --- a/exercises/Set5b.hs +++ b/exercises/Set5b.hs @@ -110,7 +110,10 @@ mapTree f Empty = Empty -- (Node 3 Empty Empty)) cull :: Eq a => a -> Tree a -> Tree a -cull val tree = todo +cull val (Node value t1 t2) + | val == value = Empty + | otherwise = Node value (cull val t1) (cull val t2) +cull val Empty = Empty ------------------------------------------------------------------------------ -- Ex 7: check if a tree is ordered. A tree is ordered if: