Command-line arguments: Difference between revisions

Content added Content deleted
No edit summary
m (→‎[[Haskell]]: formatting; fix "the the")
Line 96: Line 96:
[[Category:Haskell]]
[[Category:Haskell]]


Defined the the System module, getArgs::IO [String] provides the command-line arguments in a list.
Defined by the System module, getArgs :: IO [String] provides the command-line arguments in a list.


myprog.hs:
myprog.hs:
import System
import System
main = getArgs >>= print
main = getArgs >>= print


myprog a -h b c
myprog a -h b c
=> ["a","-h","b","c"]
=> ["a","-h","b","c"]


==[[Java]]==
==[[Java]]==