Skip to content

Instantly share code, notes, and snippets.

@thejohnfreeman
Forked from anonymous/Main.hs
Created January 17, 2016 17:25
Show Gist options
  • Save thejohnfreeman/c8d6d051fa34b3740029 to your computer and use it in GitHub Desktop.
Save thejohnfreeman/c8d6d051fa34b3740029 to your computer and use it in GitHub Desktop.
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