SlideShare une entreprise Scribd logo
1  sur  13
Haskell講義 (1)
     yingtai
自己紹介


• yingtai (@__int)
• 67th
今回やること

• Haskell の学習
• すごいH本を読み進める
• スライドは冒頭のみです
目標

• 初心者にもわかるHaskell (希望)
• プログラマならわかるHaskell (保証)
• モナドを使いこなす
1. Introduction
純粋関数型?

        Haskell   命令的言語


 状態      ない        ある


書くこと   何であるか      何をするか
命令
 • 矢印方向の時系列
 • 変数 x に再代入
 • → x が変化
 • 状態がある!
Haskellでは


• x = 5 は代入ではなく宣言
• 数学と同じです
遅延評価

• 「必要になるまで」関数を実行しない
• lazy (怠け者)
• → 無限リストとか
静的型付け


• 変数がどの型かコンパイル時に決定
型推論


• (基本的に) 型を書かなくてもいい!
• a = 5 + 4 → a :: Int
でもって


• エレガントで簡潔
• Haskell 最高∼ ✌('ω')
GHC

• もう入れてますよね?
• 講義では基本的に GHCi を使います
• 起動してみましょう

Contenu connexe

Plus de Eita Sugimoto

Plus de Eita Sugimoto (8)

電源2
電源2電源2
電源2
 
Semiotics
SemioticsSemiotics
Semiotics
 
電源
電源電源
電源
 
Lecture3
Lecture3Lecture3
Lecture3
 
Lecture2
Lecture2Lecture2
Lecture2
 
Summer seminar
Summer seminarSummer seminar
Summer seminar
 
Functional Pearl + Brainfuck
Functional Pearl + BrainfuckFunctional Pearl + Brainfuck
Functional Pearl + Brainfuck
 
ラムダ計算入門
ラムダ計算入門ラムダ計算入門
ラムダ計算入門
 

Lecture1

Notes de l'éditeur

  1. \n
  2. \n
  3. \n
  4. \n
  5. \n
  6. \n
  7. \n
  8. \n
  9. \n
  10. \n
  11. \n
  12. \n
  13. \n