Explorar el Código

Create a custom function to reverse a list

DricomDragon hace 5 años
padre
commit
93572ab22a
Se han modificado 1 ficheros con 5 adiciones y 0 borrados
  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 []