X-Git-Url: https://git.martlubbers.net/?p=cloogle-irc.git;a=blobdiff_plain;f=IRCBot.icl;h=3b620907b73267a47b952bb817c44614251a40b9;hp=6820e708bb1c05b10fcee61f1adbf0be471fd30d;hb=e81450dc6e427524ac74160cc9d54b1d8fb40cba;hpb=840f4fd6696c7af6f42251cbb263fe7c86ff2e7b diff --git a/IRCBot.icl b/IRCBot.icl index 6820e70..3b62090 100644 --- a/IRCBot.icl +++ b/IRCBot.icl @@ -14,7 +14,7 @@ import StdBool TIMEOUT :== Just 1000 -bot :: (String, Int) [IRCMessage] [IRCMessage] .a (IRCMessage .a *World -> *(Maybe [IRCMessage], .a, *World)) *World -> *(Maybe String, .a, *World) +bot :: (String, Int) [IRCMessage] [IRCMessage] .a (IRCMessage -> (.a -> .(*World -> *(Maybe [IRCMessage], .a, *World)))) *World -> *(Maybe String, .a, *World) bot (host, port) start end state bot w //Lookup hostname # (ip, w) = lookupIPAddress host w @@ -38,7 +38,7 @@ bot (host, port) start end state bot w //Close channels = (Nothing, state, closeChannel sChannel (closeRChannel rChannel w)) -process :: TCP_DuplexChannel String .a (IRCMessage .a *World -> *(Maybe [IRCMessage], .a, *World)) *World -> *(MaybeErrorString (), TCP_DuplexChannel, .a, *World) +process :: TCP_DuplexChannel String .a (IRCMessage -> (.a -> .(*World -> *(Maybe [IRCMessage], .a, *World)))) *World -> (MaybeErrorString (), TCP_DuplexChannel, .a, *World) process chan acc state bot w //See if we have a message = case split "\r\n" acc of