-
-
Save thejohnfreeman/c8d6d051fa34b3740029 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module Main where | |
import System.Environment | |
main :: IO () | |
main = do | |
args <- getArgs | |
let num1 = read $ args !! 0 | |
let num2 = read $ args !! 1 | |
res <- num1 + num2 | |
print res | |
main = do | |
args <- getArgs | |
print $ sum $ map read args | |
main = getArgs >>= print . sum . map read |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment