2009-04-01から1ヶ月間の記事一覧

Real World Haskell - 第5章 Part3 A more general look at rendering 〜 Practical pointers and further reading

Real World Haskell で Haskell を継続的に勉強中。 Chapter 5. Writing a library: working with JSON data Chapter 5. Writing a library: working with JSON data A more general look at rendering Prettify module つくるよ Developing Haskell code wi…

Ubuntu 8.10 -> 9.04 upgrade

OS

Eee PC S101 で使っている Ubuntu をアップデートマネージャを使って 9.04 へ更新した。所要時間は約 4時間。 今のところ問題は発生していない。Artwork がシンプルになったのは少し残念。http://www.ubuntu.com/news/ubuntu-9.04-desktop

Real World Haskell - 第5章 Part2 The anatomy of a Haskell module 〜 Type inference is a double-edged sword

Real World Haskell で Haskell を継続的に勉強中。 Chapter 5. Writing a library: working with JSON data Chapter 5. Writing a library: working with JSON data The anatomy of a Haskell module module 宣言を書き、exports を列挙し、where で終わる …

“A tutorial on the universality and expressiveness of fold”

http://www.cs.nott.ac.uk/~gmh/fold.pdfChapter 4. Functional programming The article [Hutton99] is an excellent and deep tutorial covering folds. It includes many examples of how to use simple, systematic calculation techniques to turn func…

のんびり Haskell

のんびりHaskell − @IT関数適用、関数の型、関数束縛、関数抽象、カリー化などが一気に説明されているので復習に良い。

関連リンク

http://mitpress.mit.edu/sicp/full-text/book/book.html http://www.csus4.net/hiki/SICPReading/?LispImplForSICP http://sicp.ipl.t.u-tokyo.ac.jp/Gauche も。 http://practical-scheme.net/wiliki/wiliki2.cgi?Shiro Gauche - A Scheme Implementation …

Real World Haskell - 第5章 Part1 A whirlwind tour of JSON, Representing JSON data in Haskell

Real World Haskell で Haskell を継続的に勉強中。 Chapter 5. Writing a library: working with JSON data Chapter 5. Writing a library: working with JSON data A whirlwind tour of JSON JSON を操作するライブラリを実装していく JSON (JavaScript Ob…

Real World Haskell 読書会

Real World Haskell 読書会 に参加した。様々な分野の人が参加されていて興味深かった。 皆さん、ML など複数の関数型言語の経験があるようで、自分が一番初心者な感じだった。 隣の席に monao (nario) の id:mokehehe さんがいて、ちょっとビックリ。 id:sm…

Real World Haskell - 第4章 Part12 Space leaks and strict evaluation

Real World Haskell で Haskell を継続的に勉強中。 Chapter 4. Functional programming Chapter 4. Functional programming Space leaks and strict evaluation foldl 以外にも space leak が発生する場合がある seq で non-strict evaluation をバイパスで…

Real World Haskell - 第4章 Part11 Code reuse through composition

Real World Haskell で Haskell を継続的に勉強中。 Chapter 4. Functional programming Chapter 4. Functional programming Code reuse through composition 関数合成は . でできる suffixes2 xs = init (tails xs) compose :: (b -> c) -> (a -> b) -> a -…

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行が濃…