Explorar o código

Create custom delete function

DricomDragon %!s(int64=5) %!d(string=hai) anos
pai
achega
6627d0b022
Modificáronse 1 ficheiros con 4 adicións e 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)