Browse Source

Create custom delete function

DricomDragon 5 năm trước cách đây
mục cha
commit
6627d0b022
1 tập tin đã thay đổi với 4 bổ sung0 xóa
  1. 4 0
      listfct.hs

+ 4 - 0
listfct.hs

@@ -3,3 +3,7 @@ myexchanger xs zs = case xs of
 	y:ys -> myexchanger ys (y:zs)
 
 myreverse xs = myexchanger xs []
+
+mydelete l y = case l of
+	[] -> []
+	x:xs -> if x == y then xs else x:(mydelete xs y)