Explorar o código

Create a custom function to reverse a list

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