From 93ae36c3ab82e612adf7f00d3df8f9f514fcee0f Mon Sep 17 00:00:00 2001 From: darkf Date: Fri, 1 Nov 2013 21:36:36 -0700 Subject: [PATCH] update tuple literals --- irc.lamb | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/irc.lamb b/irc.lamb index d2bca9f..7112d65 100644 --- a/irc.lamb +++ b/irc.lamb @@ -22,7 +22,7 @@ fst((x, _)) -> x. is_just(("just", _)) -> true. is_just(_) -> false. -is_nothing(("nothing")) -> true. +is_nothing(("nothing",)) -> true. is_nothing(_) -> false. unwrap_maybe(("just", x)) -> x. @@ -39,7 +39,7 @@ is_member(x::xs, member) -> map_insert(assoc, key, value) -> (key, value) :: assoc. -- lookup by key -map_lookup([], _) -> ("nothing"). +map_lookup([], _) -> ("nothing",). map_lookup((k,v)::xs, key) -> if k == key then ("just", v) else map_lookup(xs, key). @@ -82,13 +82,13 @@ end. -- state getters getFactoids(state) -> do - (factoids) = state; + (factoids,) = state; factoids end. -- state setters setFactoids(state, factoids) -> do - (factoids) + (factoids,) end. -- factoid serialization @@ -246,7 +246,7 @@ mainloop(state) -> false. putstrln("initializing"). -initialState = (loadFactoids()). +initialState = (loadFactoids(),). putstrln("beginning mainloop"). loop(mainloop, initialState).