add list\intercalate
This commit is contained in:
parent
209c815f80
commit
aab89f838b
|
@ -67,3 +67,7 @@ drop(n, _::xs) -> drop(n-1, xs).
|
||||||
take(0, _) -> [].
|
take(0, _) -> [].
|
||||||
take(n, []) -> [].
|
take(n, []) -> [].
|
||||||
take(n, x::xs) -> x :: take(n-1, xs).
|
take(n, x::xs) -> x :: take(n-1, xs).
|
||||||
|
|
||||||
|
intercalate(s, []) -> "".
|
||||||
|
intercalate(s, x::[]) -> x.
|
||||||
|
intercalate(s, x::xs) -> x + s + intercalate(s, xs).
|
||||||
|
|
Loading…
Reference in New Issue