ãªãã§ãã»ããã¼ã§è³ªåããã£ãæåãGHCã®ã¬ãã¼ã¸ã³ã¬ã¯ã·ã§ã³ã®äºã¨ã調ã¹ããã¨æã£ã¦ããã®ã ããã©ããã®ã¨ãã大å¦ã®å®é¨ã§ä½è£ããªãã®ã§ããã°ããå®é¨ä¸ã«æ°ã¥ããäºã¨ãæ¸ãã¦ããã¨æãã¾ãã Haskellã§ã®ã¨ã©ã¼å¦çã®é£ãã Haskellã§æ軽ã«ä½¿ããã¨ã©ã¼å¦çã¨ãã¦ã¯erroré¢æ°ã使ãæ¹æ³ãããã¾ãããä¾ãã°ä»¥ä¸ã®ã³ã¼ãã®å ´å parse '1' = 1 parse '2' = 2 parse '3' = 3 parse x = error $ "invalid input : " ++ show x main = do input <- getContents putStrLn "parsing ... " nums <- return $ map parse input putStrLn "add numbers ... " result <- return $ sum
{{#tags}}- {{label}}
{{/tags}}