Parcourir la source

Create a custom function to reverse a list

DricomDragon il y a 5 ans
Parent
commit
93572ab22a
1 fichiers modifiés avec 5 ajouts et 0 suppressions
  1. 5 0
      listfct.hs

+ 5 - 0
listfct.hs

@@ -0,0 +1,5 @@
+myexchanger xs zs = case xs of
+	[] -> zs
+	y:ys -> myexchanger ys (y:zs)
+
+myreverse xs = myexchanger xs []