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

Real World Haskell - 第4章 Part10 As-patterns

Real World Haskell で Haskell を継続的に勉強中。 Chapter 4. Functional programming Chapter 4. Functional programming As-patterns as-pattern を使うと読みやすいコードが書ける as-pattern ではデータのコピーが発生しないので allocation を節約で…

Real World Haskell - 第4章 Part9 Partial function application and currying

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 - 第4章 Part8 Anonymous (lambda) functions

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 - 第4章 Exercises Part2

Real World Haskell で Haskell を継続的に勉強中。 Chapter 4. Functional programming Chapter 4. Functional programming回答は順次追記していく。 Excercise が溜まってきたので消化しないと・・・ Excercises (Section "Left folds, laziness, and spac…

Real World Haskell - 第4章 Part7 How to think about loops (続き)

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 - 第4章 Part6 How to think about loops (続き)

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 - 第4章 Part5 How to think about loops (続き)

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 - 第4章 Part4 How to think about loops (続き)

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 - 第4章 Part3 How to think about loops

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 - 第4章 Exercises Part1

Real World Haskell で Haskell を継続的に勉強中。 Chapter 4. Functional programming Chapter 4. Functional programming回答は順次追記していく。 Excercises (Section "Special string-handling functions" の後にあるもの) 1.Write your own “safe” de…

Emacs と cabal-install の設定

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 - 第4章 Part1 like a "laundry list"

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 - 第3章 Exercises Part2

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 - 第3章 Exercises Part1

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…

Super Nario Bros.

スーパーマリオナリオは Haskell のキラーアプリとなるに違いない。Haskellで敵を踏み潰したりするゲームを作ってみた - imHo 現状 22ソース、1605行 この行数で書けるのか。 HSDL を使っているから短いというのもあるとは思うのだが、 Haskell は「 1行が濃…

Real World Haskell - 第3章 Part11 Conditional evaluation with guards

Real World Haskell で Haskell を継続的に勉強中。 Defining Types, Streamlining Functions Chapter 3. Defining Types, Streamlining Functionsようやく 3章も終わり。 Conditional evaluation with guards guard expression でパターンマッチに条件を付…

Real World Haskell - 第3章 Part10 The case expression, Common beginner mistakes with patterns

Real World Haskell で Haskell を継続的に勉強中。 Defining Types, Streamlining Functions Chapter 3. Defining Types, Streamlining Functions The case expression case を使えば関数定義のときのようにパターンマッチできる fromMaybe defval wrapped …

Software Design 2009/04

2009-03-16 「―Haskellで学ぶ― 関数プログラミングことはじめ」にて記事を書きました.読んでいただけると嬉しいです. というわけで読んでみました。Software Design 2009年4月号|技術評論社 特別企画 〜Haskellで学ぶ〜 関数プログラミングことはじめ 関…

Real World Haskell - 第3章 Part9 The offside rule and white space in an expression

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 - 第3章 Part8 Introducing local variables

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 の Receive Window Size 変更で通信速度大幅アップ!!

PPTP Client 1.7.0 のソースを読んでいたら、Receive Windows Size が固定になっていることに気付いた。PPTP ClientOutgoing Call Request のパラメータは固定な実装らしい。 Receive Windows Size が 3というのは、余りにも小さいと思うのだが、理由がある…

Real World Haskell 読書会

id:nobsun さん主催の「Real World Haskell 読書会」に参加予定。このあたりを見る限り、とてもすごい人のようなので楽しみだ。 のんびりHaskell − @IT jus 2009.3(2) Benkyokai http://www.timedia.co.jp/company/books/3467693767.html僕はまだまだ Haske…

Qt SDK 2009.01.1

Windows XP 上の Qt Creator 2009.01 でソースをビルドすると % の使い方が誤っています というような表示のコマンドプロンプトが一瞬出て、すぐに status code 0 で exit していた。 Qt のサイトを見ていたら SDK のバージョンがさりげなく 2009.01.1 にな…

Real World Haskell - 第3章 Part7 Reporting errors

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 - サーバに接続できないぞ

Real World Haskell で Haskell を継続的に勉強中。...なのだが、サーバに接続できない状態が続いている。

Real World Haskell - 第3章 Part6 Parameterised types, Recursive types

Real World Haskell で Haskell を継続的に勉強中。 Defining Types, Streamlining Functions Chapter 3. Defining Types, Streamlining Functions Parameterised types 独自に定義した型でも list type と同様にポリモーフィズム可能 型定義で型変数を利用…

Real World Haskell - 第3章 Part5 Record syntax

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 でクロスプラットフォームな Web ブラウザをさくっと作る

Qt Creator だと WebKit なブラウザが簡単に作れるよ!!、な動画。 コードが全然見えないのが難点。 この動画で Ruby on Rails みたく流行るんだろうか・・・

Real World Haskell - 第3章 Part4 Pattern matching

Real World Haskell で Haskell を継続的に勉強中。 Defining Types, Streamlining Functions Chapter 3. Defining Types, Streamlining Functions Pattern matching myNot True = False myNot False = True Haskell では上記のような式の組み合わせで 1つの…