Playing around with the ReadArgs package, it seems that it does not support single-argument situations.
{-# LANGUAGE ScopedTypeVariables #-}
import ReadArgs (readArgs)
main = do
(foo :: Int) <- readArgs
print foo
The error is (when using version 1.0):
No instance for (ReadArgs.ArgumentTuple Int)
arising from a use of `readArgs'
My question is twofold:
- How does
readArgs
work? - How can that library be adjusted to allow it to work with a single argument as well?
N.B. version 1.1 of ReadArgs eliminates this "error"; see comments.