2011-03-10から1日間の記事一覧

Real World Haskell Chapter3

Nullable.hsはNulllabel.hsのtypo? --Nullable.hs data Maybe a = Just a | Nothing someBool = Just True someString = Just "something" wrapped = Just (Just "wrapped") 写経すると以下のエラー. よく分からんが,定義が重複しているみたい? [1 of 1] C…

Real World Haskell Chapter 2

last [] last [1..] Haskellで循環リストみたいなものを作れるのならば. --lastButOne.hs lastButOne (x:xs) = if length(xs) == 1 then x else lastButOne xs 以下のほうが,関数型ぽいかな? --lastButOne.hs lastButOne (x:[_]) = x lastButOne (x:xs) =…

Real World Haskell Chapter1

--wc.hs main = interact wordCount where wordCount input = show(length(lines input)) ++ "\t" ++ show(length(words input)) ++ "\t" ++ show(length( input)) ++ "\n"

Real World Haskell

Haskellの学習を始めた. "Real World Haskell"の練習問題を解いていこうと思います. どこかにカンニングできるところがあれば,教えてください. 書籍中のサポートページのURLが間違っている. 正しいページに行っても,正誤表には辿りつけない.(存在しな…