2011-01-01から1年間の記事一覧

Macのpathの設定

このあたり参照で http://superuser.com/questions/31353/path-in-vim-doesnt-match-terminal http://d.hatena.ne.jp/yhino/20100908/1283963661以下のファイルをいじる. /etc/paths以下のプログラムが自動設定するらしい. /usr/libexec/path_helperzshenv…

近況

最近Haskell触れていないな. c++ばっかだ. c++は落とし穴が多く,さらに,冗長な記述が 多いのであまり好きじゃない. Effective C++を読んでいるけど, 無駄に覚えないといけないことが多かったり, 歴史的な経緯で,推奨される方法の方が冗長だったりと…

macのhaskellについて

macportsのhaskellは使ったら駄目. ghciに-1.0を入力するだけでsegv発動するよ. ちゃんと本家から落とすこと. http://hackage.haskell.org/platform/

vimのvisual modeからコピペする方法.

選択後 !pbcopy;pbpasteだそうだ. http://d.hatena.ne.jp/snaka72/20090523/1243093317

Real World Haskell Chapter3 続き

昨日よくわからないと言っていた練習問題の続き. rightとleftを区別する方法がわからないので,無視. --Tree2.hs data Tree a = Node a (Maybe(Tree a)) (Maybe(Tree a)) deriving (Show) simpleTree = Just (Node "parent" (Just (Node "left leaf" Nothi…

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が間違っている. 正しいページに行っても,正誤表には辿りつけない.(存在しな…