]> git.rmz.io Git - my-scheme.git/commitdiff
Read two arguments from commandline
authorSamir Benmendil <me@rmz.io>
Sat, 13 Jan 2018 21:59:14 +0000 (21:59 +0000)
committerSamir Benmendil <me@rmz.io>
Sat, 13 Jan 2018 21:59:14 +0000 (21:59 +0000)
`!!` is the "list indexing" operator. It returns the value in the list
on the lhs at the index on the rhs.

`++` concatenates two lists.

A string is a list of chars.

app/Main.hs

index c0766c1faa3645d237fed54bc0e83d3dbcdd4d08..cdd564b7550b29999e1707a7a0dc8d76aa5e4119 100644 (file)
@@ -4,4 +4,4 @@ import System.Environment
 main :: IO ()
 main = do
     args <- getArgs
-    putStrLn ("Hello, " ++ args !! 0)
+    putStrLn (args !! 0 ++ args !! 1)