update tuple literals
This commit is contained in:
parent
0b6627fae9
commit
93ae36c3ab
1 changed files with 5 additions and 5 deletions
10
irc.lamb
10
irc.lamb
|
@ -22,7 +22,7 @@ fst((x, _)) -> x.
|
||||||
is_just(("just", _)) -> true.
|
is_just(("just", _)) -> true.
|
||||||
is_just(_) -> false.
|
is_just(_) -> false.
|
||||||
|
|
||||||
is_nothing(("nothing")) -> true.
|
is_nothing(("nothing",)) -> true.
|
||||||
is_nothing(_) -> false.
|
is_nothing(_) -> false.
|
||||||
|
|
||||||
unwrap_maybe(("just", x)) -> x.
|
unwrap_maybe(("just", x)) -> x.
|
||||||
|
@ -39,7 +39,7 @@ is_member(x::xs, member) ->
|
||||||
map_insert(assoc, key, value) -> (key, value) :: assoc.
|
map_insert(assoc, key, value) -> (key, value) :: assoc.
|
||||||
|
|
||||||
-- lookup by key
|
-- lookup by key
|
||||||
map_lookup([], _) -> ("nothing").
|
map_lookup([], _) -> ("nothing",).
|
||||||
map_lookup((k,v)::xs, key) ->
|
map_lookup((k,v)::xs, key) ->
|
||||||
if k == key then ("just", v)
|
if k == key then ("just", v)
|
||||||
else map_lookup(xs, key).
|
else map_lookup(xs, key).
|
||||||
|
@ -82,13 +82,13 @@ end.
|
||||||
|
|
||||||
-- state getters
|
-- state getters
|
||||||
getFactoids(state) -> do
|
getFactoids(state) -> do
|
||||||
(factoids) = state;
|
(factoids,) = state;
|
||||||
factoids
|
factoids
|
||||||
end.
|
end.
|
||||||
|
|
||||||
-- state setters
|
-- state setters
|
||||||
setFactoids(state, factoids) -> do
|
setFactoids(state, factoids) -> do
|
||||||
(factoids)
|
(factoids,)
|
||||||
end.
|
end.
|
||||||
|
|
||||||
-- factoid serialization
|
-- factoid serialization
|
||||||
|
@ -246,7 +246,7 @@ mainloop(state) ->
|
||||||
false.
|
false.
|
||||||
|
|
||||||
putstrln("initializing").
|
putstrln("initializing").
|
||||||
initialState = (loadFactoids()).
|
initialState = (loadFactoids(),).
|
||||||
|
|
||||||
putstrln("beginning mainloop").
|
putstrln("beginning mainloop").
|
||||||
loop(mainloop, initialState).
|
loop(mainloop, initialState).
|
||||||
|
|
Loading…
Reference in a new issue