remove head/tail

This commit is contained in:
darkf 2013-10-26 23:28:41 -07:00
parent 96cb54a70a
commit 427f5ccd29
1 changed files with 2 additions and 3 deletions

View File

@ -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).