From fa1bf6c2eac1c9f7969ff29504c9f51b9ba48008 Mon Sep 17 00:00:00 2001 From: Determinant Date: Mon, 29 May 2017 01:11:20 -0400 Subject: finish vol 3 --- 21-28/21.hs | 5 +++++ 1 file changed, 5 insertions(+) create mode 100644 21-28/21.hs (limited to '21-28/21.hs') diff --git a/21-28/21.hs b/21-28/21.hs new file mode 100644 index 0000000..4cbeb49 --- /dev/null +++ b/21-28/21.hs @@ -0,0 +1,5 @@ +insertAt :: a -> [a] -> Int -> [a] + +insertAt e (x:xs) n | n > 1 = x:insertAt e xs (n - 1) +insertAt e l 1 = e:l +insertAt _ l _ = l -- cgit v1.2.3-70-g09d2