소스 검색

Create a custom function to reverse a list

DricomDragon 5 년 전
부모
커밋
93572ab22a
1개의 변경된 파일5개의 추가작업 그리고 0개의 파일을 삭제
  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 []