Parcourir la source

Create custom delete function

DricomDragon il y a 5 ans
Parent
commit
6627d0b022
1 fichiers modifiés avec 4 ajouts et 0 suppressions
  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)