Explorar el Código

Create custom delete function

DricomDragon hace 5 años
padre
commit
6627d0b022
Se han modificado 1 ficheros con 4 adiciones y 0 borrados
  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)