Multiple actions upon a case statement in Haskell

Posted by Schroedinger on Stack Overflow See other posts from Stack Overflow or by Schroedinger
Published on 2010-05-16T11:11:05Z Indexed on 2010/05/16 11:20 UTC
Read the original article Hit count: 296

Filed under:
|
|
|

One last question for the evening, I'm building the main input function of my Haskell program and I have to check for the args that are brought in

so I use

args <- getArgs
case length args of
    0 -> putStrLn "No Arguments, exiting"
    otherwise -> { other methods here}

Is there an intelligent way of setting up other methods, or is it in my best interest to write a function that the other case is thrown to within the main?

Or is there an even better solution to the issue of cases. I've just got to take in one name.

© Stack Overflow or respective owner

Related posts about haskell

Related posts about haskell-io