Haskell

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…

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…

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 =…

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つの…

Real World Haskell - 第3章 Part3 Algebraic data types

Real World Haskell で Haskell を継続的に勉強中。 Defining Types, Streamlining Functions Chapter 3. Defining Types, Streamlining Functions Algebraic data types algebraic data type は value constructor を複数持てる data Bool = False | True t…

Real World Haskell - 第3章 Part2 Type synonyms

Real World Haskell で Haskell を継続的に勉強中。 Defining Types, Streamlining Functions Chapter 3. Defining Types, Streamlining Functions Type synonyms type の synonym を作成可能 type CustomerID = Int type ReviewBody = String data BetterRe…

Real World Haskell - 第3章 Part1 Defining a new data type

Real World Haskell で Haskell を継続的に勉強中。 Defining Types, Streamlining Functions Chapter 3. Defining Types, Streamlining Functions Defining a new data type data BookInfo = Book Int String [String] deriving (Show) myInfo = Book 97801…

Real World Haskell - 第2章 練習問題

Real World Haskell を継続的に勉強中。 Exercises Chapter 2. Types and Functions Useful composite data types: lists and tuples What are the types of the following expressions? * False * (["foo", "bar"], 'a') * [(True, []), (False, 'a')] Prel…

Real World Haskell - 第2章

Real World Haskell を継続的に勉強中。 型と関数 Chapter 2. Types and Functions Haskell's type system strong types 勝手に型を変換して解釈することが無いので、コンパイル時に型に関するバグが必ずとれる well typed と ill typed static types コンパ…

Real World Haskell - 第1章 練習問題

Real World Haskell を継続的に勉強中。 Exercises Chapter 1. Getting Started 1. Enter the following expressions into ghci. What are their types? * 5 + 8 * 3 * 5 + 8 * 2 + 4 * (+) 2 4 * sqrt 16 * succ 6 * succ 7 * pred 9 * pred 8 * sin (pi / …

プログラム・プロムナード/Haskellプログラミング

Real World Haskell の合間に。http://www.ipsj.or.jp/07editj/promenade/index.html 2005年4月号 関数プログラミングの妙味(和田英一) PDF:450KB 2005年5月号 木(tree)で遊ぶ(山下伸夫) PDF:340KB 2005年6月号 数当てゲームを解く(尾上能之) PDF:36…

Real World Haskell - 第1章

Real World Haskell を継続的に勉強中。 始めよう Chapter 1. Getting Started メジャーな実装は Hugs, GHC the Glasgow Haskell Compiler (GHC) がいいよ GHC ghc: コンパイラ ghci: 対話的なインタプリタ python, irb みたいなもの runghc: インタプリタ G…

Real World Haskell - なんで Haskell?

http://d.hatena.ne.jp/yohtani/edit?date=20090219 Haskell は気になっていたので、がんばって読んでみよう。 というわけで、Real World Haskell を継続的に勉強。 ポールグレアムがハッカーと画家で "Lisp 最強!!" とか叫んでいるのを読むと、関数型言語が…