From 427f5ccd293ed58474058f019028f2e2aeeedcb4 Mon Sep 17 00:00:00 2001 From: darkf Date: Sat, 26 Oct 2013 23:28:41 -0700 Subject: [PATCH] remove head/tail --- irc.lamb | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/irc.lamb b/irc.lamb index bf32e20..aec914f 100644 --- a/irc.lamb +++ b/irc.lamb @@ -1,5 +1,7 @@ -- First we'll define some helper functions +-- irc stuff + -- Splits a string by spaces, or until it encounters a :, whereby the following is considered one element. splitirc'("", stracc, acc) -> acc + [stracc]. splitirc'(" "::xs, stracc, acc) -> do @@ -13,9 +15,6 @@ splitirc'(x::xs, stracc, acc) -> splitirc'(xs, stracc + x, acc). -- helper function splitirc(str) -> splitirc'(str, "", []). -head(x::_) -> x. -tail(_::xs) -> xs. - -- (result, rest) takeUntilSpace'(" "::xs, acc) -> (acc, xs). takeUntilSpace'(x::xs, acc) -> takeUntilSpace'(xs, acc + x).