[Haskell-beginners] eval command?

Alex Shearn s0700157 at sms.ed.ac.uk
Mon Oct 27 17:33:21 EDT 2008

Hey all - I've been trying to write an IRC bot following the guide on 
the wiki, and we (those of us on the channel) were trying to get it to 
evaluate commands.
So far, we have this for "eval" stuff, but is there anyway to specify a 
"parse in haskell" sort of thing?

-- Dispatch a command
eval :: String -> Net ()
eval "!endbot" = write "QUIT" ":Exiting" >> io (exitWith ExitSuccess)
eval x | "!haskbot " `isPrefixOf` x = privmsg (drop 9 x)
eval _ = return () -- ignore everything else

is there anyway to do something like:

eval "!eval" `isPrefixOf` x = eval blah


if this isn't beginners' stuff, let me know, i'll repost to the main 
mailing list.

Many thanks,

Alex Shearn

The University of Edinburgh is a charitable body, registered in
Scotland, with registration number SC005336.

More information about the Beginners mailing list