From aab89f838b505fabeeaf36c6d2733573167b5b7e Mon Sep 17 00:00:00 2001 From: darkf Date: Thu, 19 Jun 2014 01:03:47 -0700 Subject: [PATCH] add list\intercalate --- mods/std/list.lamb | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/mods/std/list.lamb b/mods/std/list.lamb index 2d3282e..37a0967 100644 --- a/mods/std/list.lamb +++ b/mods/std/list.lamb @@ -67,3 +67,7 @@ drop(n, _::xs) -> drop(n-1, xs). take(0, _) -> []. take(n, []) -> []. take(n, x::xs) -> x :: take(n-1, xs). + +intercalate(s, []) -> "". +intercalate(s, x::[]) -> x. +intercalate(s, x::xs) -> x + s + intercalate(s, xs).