Real World Haskell
実戦で学ぶ関数型言語プログラミング
Bryan O'Sullivan, John Goerzen, Don Stewart(著)
山下 伸夫, 伊東 勝利
株式会社タイムインターメディア(翻訳)
開発環境
- OS X Lion - Apple(OS)
- BBEdit - Bare Bones Software, Inc.(Text Editor)
- プログラミング言語: Haskell (純粋関数型)
Real World Haskell』(Bryan O'Sullivan、John Goerzen、Don Stewart(著)、山下 伸夫、伊東 勝利、株式会社タイムインターメディア(翻訳)、オライリー・ジャパン、2009年、ISBN978-4-87311-423-3)の1章(始めましょう)練習問第3、4.を解いてみる。
3, 4.
コード(BBEdit)
sample.hs
-- file: sample.hs -- "--" で始まる行はコメント main = interact wordCount where wordCount input = show (length (words input)) ++ "\n"
入出力結果(Terminal)
$ runghc sample < quux.txt 14 $
sample.hs
-- file: sample.hs -- "--" で始まる行はコメント main = interact wordCount where wordCount input = show (length (input)) ++ "\n"
入出力結果(Terminal)
$ runghc sample < quux.txt 122 $
0 コメント:
コメントを投稿