2009-01-01から1年間の記事一覧
Real World Haskell で Haskell を継続的に勉強中。 Chapter 4. Functional programming Chapter 4. Functional programming As-patterns as-pattern を使うと読みやすいコードが書ける as-pattern ではデータのコピーが発生しないので allocation を節約で…
Real World Haskell で Haskell を継続的に勉強中。 Chapter 4. Functional programming Chapter 4. Functional programming Partial function application and currying この説明を待っていた! You may wonder why the -> arrow is used for what seems to …
Real World Haskell で Haskell を継続的に勉強中。 Chapter 4. Functional programming Chapter 4. Functional programming Anonymous (lambda) functions Haskell では無名関数はλ関数とも呼ぶ \ でλ関数が使える \ は lambda と読む 日本だと backslash …
RWH (Real World Haskell) では末尾再帰 (tail recursion) がサラッと説明無しに出てきたので、 RWH は少し離れて、末尾再帰について少し調べていた。第2回 「単一代入」と「末尾再帰」 | 日経 xTECH(クロステック) 「関数が返ってきた後にする処理」がな…
Real World Haskell で Haskell を継続的に勉強中。 Chapter 4. Functional programming Chapter 4. Functional programming回答は順次追記していく。 Excercise が溜まってきたので消化しないと・・・ Excercises (Section "Left folds, laziness, and spac…
Real World Haskell で Haskell を継続的に勉強中。 Chapter 4. Functional programming Chapter 4. Functional programming How to think about loops Left folds, laziness, and space leaks foldl は space leak を起こすので thunk を作らない foldl' を…
Real World Haskell で Haskell を継続的に勉強中。 Chapter 4. Functional programming Chapter 4. Functional programming How to think about loops for/while ループは Haskell には存在しないので別の方法で表現する必要がある Folding from the right …
Real World Haskell で Haskell を継続的に勉強中。 Chapter 4. Functional programming Chapter 4. Functional programming How to think about loops for/while ループは Haskell には存在しないので別の方法で表現する必要がある The left fold foldl :: …
Real World Haskell で Haskell を継続的に勉強中。 Chapter 4. Functional programming Chapter 4. Functional programming How to think about loops for/while ループは Haskell には存在しないので別の方法で表現する必要がある Selecting pieces of inp…
Real World Haskell で Haskell を継続的に勉強中。 Chapter 4. Functional programming Chapter 4. Functional programming How to think about loops for/while ループは Haskell には存在しないので別の方法で表現する必要がある Explicit recursion impo…
Real World Haskell で Haskell を継続的に勉強中。 Chapter 4. Functional programming Chapter 4. Functional programming回答は順次追記していく。 Excercises (Section "Special string-handling functions" の後にあるもの) 1.Write your own “safe” de…
Real World Haskell - 第1章 - バイナリアンを目指して GHC 6.10.1をWindows XP にインストールした。 さらに Emacs と cabal-install を設定した。 Emacs ftp://ftp.gnu.org/gnu/emacs/windows/ から emacs-22.3-bin-i386.zip をダウンロードして解凍 解凍…
Real World Haskell で Haskell を継続的に勉強中。 Chapter 4. Functional programming Chapter 4. Functional programming Infix functions infix notations is purely a syntactic convenience Woking with lists :module +Data.List length :: [a] -> In…
Real World Haskell で Haskell を継続的に勉強中。 Defining Types, Streamlining Functions Chapter 3. Defining Types, Streamlining Functions問題が多いので回答は順次追記していく。 Exercises 1.Write a function that computes the number of elemen…
Real World Haskell で Haskell を継続的に勉強中。 Defining Types, Streamlining Functions Chapter 3. Defining Types, Streamlining Functions Exercises (Section "Recursive types" の最後にあるもの) 1. Write the converse of fromList for the List…
スーパーマリオナリオは Haskell のキラーアプリとなるに違いない。Haskellで敵を踏み潰したりするゲームを作ってみた - imHo 現状 22ソース、1605行 この行数で書けるのか。 HSDL を使っているから短いというのもあるとは思うのだが、 Haskell は「 1行が濃…
Real World Haskell で Haskell を継続的に勉強中。 Defining Types, Streamlining Functions Chapter 3. Defining Types, Streamlining Functionsようやく 3章も終わり。 Conditional evaluation with guards guard expression でパターンマッチに条件を付…
Real World Haskell で Haskell を継続的に勉強中。 Defining Types, Streamlining Functions Chapter 3. Defining Types, Streamlining Functions The case expression case を使えば関数定義のときのようにパターンマッチできる fromMaybe defval wrapped …
2009-03-16 「―Haskellで学ぶ― 関数プログラミングことはじめ」にて記事を書きました.読んでいただけると嬉しいです. というわけで読んでみました。Software Design 2009年4月号|技術評論社 特別企画 〜Haskellで学ぶ〜 関数プログラミングことはじめ 関…
Real World Haskell で Haskell を継続的に勉強中。 Defining Types, Streamlining Functions Chapter 3. Defining Types, Streamlining Functions The offside rule and white space in an expression Haskell はインデントでブロックを区別する 移植性を考…
Real World Haskell で Haskell を継続的に勉強中。 Defining Types, Streamlining Functions Chapter 3. Defining Types, Streamlining Functions Introducing local variables let か where でローカル変数を定義できる lend amount balance = let reserve…
PPTP Client 1.7.0 のソースを読んでいたら、Receive Windows Size が固定になっていることに気付いた。PPTP ClientOutgoing Call Request のパラメータは固定な実装らしい。 Receive Windows Size が 3というのは、余りにも小さいと思うのだが、理由がある…
id:nobsun さん主催の「Real World Haskell 読書会」に参加予定。このあたりを見る限り、とてもすごい人のようなので楽しみだ。 のんびりHaskell − @IT jus 2009.3(2) Benkyokai http://www.timedia.co.jp/company/books/3467693767.html僕はまだまだ Haske…
Windows XP 上の Qt Creator 2009.01 でソースをビルドすると % の使い方が誤っています というような表示のコマンドプロンプトが一瞬出て、すぐに status code 0 で exit していた。 Qt のサイトを見ていたら SDK のバージョンがさりげなく 2009.01.1 にな…
Real World Haskell で Haskell を継続的に勉強中。 Defining Types, Streamlining Functions Chapter 3. Defining Types, Streamlining Functions Reporting errors error :: String -> a error の result type は常に正しい error は abort する mySecond …
Real World Haskell で Haskell を継続的に勉強中。...なのだが、サーバに接続できない状態が続いている。
Real World Haskell で Haskell を継続的に勉強中。 Defining Types, Streamlining Functions Chapter 3. Defining Types, Streamlining Functions Parameterised types 独自に定義した型でも list type と同様にポリモーフィズム可能 型定義で型変数を利用…
Real World Haskell で Haskell を継続的に勉強中。 Defining Types, Streamlining Functions Chapter 3. Defining Types, Streamlining Functions Record syntax data type の components への accessors は、record syntax で簡単に書ける data Customer =…
Qt Creator だと WebKit なブラウザが簡単に作れるよ!!、な動画。 コードが全然見えないのが難点。 この動画で Ruby on Rails みたく流行るんだろうか・・・
Real World Haskell で Haskell を継続的に勉強中。 Defining Types, Streamlining Functions Chapter 3. Defining Types, Streamlining Functions Pattern matching myNot True = False myNot False = True Haskell では上記のような式の組み合わせで 1つの…