浏览代码

Create custom delete function

DricomDragon 5 年之前
父节点
当前提交
6627d0b022
共有 1 个文件被更改,包括 4 次插入0 次删除
  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)