I have a Haskell program which accepts 2 or 3 Ints from the command line:
-- test.hs
main :: IO ()
main = do
args <- fmap (read . head) getArgs
case args of
[x,y,a] -> doGeneration x y a
[x,y] -> doGeneration x y 10
_ -> usage
However, when I run it with arguments:
$ ./test 100 200
divide: Prelude.read: no parse
Why?