SlideShare a Scribd company logo
1 of 24
Download to read offline
Haskell
Language Update
LL Ring 2006

       酒井 政裕
       (慶應義塾大学大学院)
       sakai@sfc.keio.ac.jp
Agenda

 What is Haskell?
 Haskell をとりまく状況
 最近のHaskell
What is Haskell?

   みんな知ってるよね?
Haskellとは

 関数型言語の代表格
 純粋関数型
  遅延評価, 非正格, 参照透明
 静的型付け
  多相型, 型推論, 型クラス
関数型プログラミング

(what)」を素朴に書く
「どうするか(how)」より「何をするか

数学的関数に基づく
 同じ引数に対しては同じ結果
 副作用が存在しない
実行順序とか気にしない
型
静的型付け
    コンパイルが通れば、実行時に型エラーが
    起こらないことが保障される
型推論
    勝手に型を推論してくれるので、
    型は原則として省略可能
多相型 + 型クラス
    柔軟な型付け
性能 (GHCの場合)

実は結構速い
 対象分野にもよるけど
Computer Language Shootout
Benchmarks で一位になっていたこ
ともあり
(例) おなじみのクイックソート


qsort :: Ord a => [a] -> [a]
qsort [] = []
qsort (a:xs) = qsort [ x | x <- xs, x < a ] ++
               [a] ++
               qsort [ x | x <- xs, x >= a ]
(例) おなじみの素数列挙

primes = map head (iterate sieve [2..])
sieve (p:xs) = [ x | x <- xs, x `mod` p /= 0 ]

  iterate は
  iterate f x = x : iterate f (f x)
  で定義される関数
  iterate (1+) 0 ⇒ [0, 1, 2, 3, ..]
Haskellの利点

簡潔なプログラム
強力な抽象化能力


             まさにLL
Haskellをとりまく状況
Haskellへの注目

最近は、研究者や変人だけで
なく、一般のプログラマーの興
味の対象になってきた
Pugsの影響、日本語書籍の
出版
ついに日本語の書籍が出版
国内における注目度? (1)
国内における注目度? (2)
         YAPC::Asia Tokyo?
 LLDN?
厳しい現実 (Javaとの比較)




        しょぼーん
最近のHaskell
Haskell’ (1)

 現在のHaskellの標準は Haskell 98
  1998年に策定
  2003年に改訂

 さすがに時代遅れになりつつある

 新たな標準が必要
Haskell’ (2)

   Haskell’ (Haskell Prime)
 現在策定中の新しい標準
 あくまでも保守的な改良
  処理系の拡張機能で普及しているも
  のを標準化
 予定では今年中に完成?
Haskell’ (3)

 Hierarchical Modules
 Rank-N / Rank-2 Polymorphism
 Foreign Function Interface
 Multi-parameter Type Class
 Concurrent Haskell
 etc.
最近のGHC
型システムの強化
 GADT, Impredicative Polymorphism, etc.
 新しい中間言語FC
並行/並列プログラミング
 Software Transaction Memory (STM)
 SMP対応
ソースコードのUnicodeサポート
 「λ」「←」「→」「…」等
Haskellの今後の課題?

レコード
 Polymorphic Record / Variant
Associated Types
 Functional Dependency の代替
 FD が関係的なのに対して、
 AT は関数的
etc.
まとめ

  これからもHaskellは
純粋関数型言語の標準として
   進化を続けていく
        …はず


      λλλλλ...
参考URL

本家 Haskell.org
 http://www.haskell.org/
Programming in Haskell (日本語)
 http://www.sampou.org/cgi-bin/haskell.cgi

More Related Content

More from Masahiro Sakai

Towards formal verification of neural networks
Towards formal verification of neural networksTowards formal verification of neural networks
Towards formal verification of neural networksMasahiro Sakai
 
関数プログラマから見たPythonと機械学習
関数プログラマから見たPythonと機械学習関数プログラマから見たPythonと機械学習
関数プログラマから見たPythonと機械学習Masahiro Sakai
 
Writing a SAT solver as a hobby project
Writing a SAT solver as a hobby projectWriting a SAT solver as a hobby project
Writing a SAT solver as a hobby projectMasahiro Sakai
 
RClassify: Classifying Race Conditions in Web Applications via Deterministic ...
RClassify: Classifying Race Conditions in Web Applications via Deterministic ...RClassify: Classifying Race Conditions in Web Applications via Deterministic ...
RClassify: Classifying Race Conditions in Web Applications via Deterministic ...Masahiro Sakai
 
SAT/SMT solving in Haskell
SAT/SMT solving in HaskellSAT/SMT solving in Haskell
SAT/SMT solving in HaskellMasahiro Sakai
 
SAT/SMTソルバの仕組み
SAT/SMTソルバの仕組みSAT/SMTソルバの仕組み
SAT/SMTソルバの仕組みMasahiro Sakai
 
Introduction to Max-SAT and Max-SAT Evaluation
Introduction to Max-SAT and Max-SAT EvaluationIntroduction to Max-SAT and Max-SAT Evaluation
Introduction to Max-SAT and Max-SAT EvaluationMasahiro Sakai
 
Aluminum: Principled Scenario Exploration through Minimality
Aluminum: Principled Scenario Exploration through MinimalityAluminum: Principled Scenario Exploration through Minimality
Aluminum: Principled Scenario Exploration through MinimalityMasahiro Sakai
 
代数的実数とCADの実装紹介
代数的実数とCADの実装紹介代数的実数とCADの実装紹介
代数的実数とCADの実装紹介Masahiro Sakai
 
How a CDCL SAT solver works
How a CDCL SAT solver worksHow a CDCL SAT solver works
How a CDCL SAT solver worksMasahiro Sakai
 
萩野服部研究室 スキー合宿 2012 自己紹介(酒井)
萩野服部研究室 スキー合宿 2012 自己紹介(酒井)萩野服部研究室 スキー合宿 2012 自己紹介(酒井)
萩野服部研究室 スキー合宿 2012 自己紹介(酒井)Masahiro Sakai
 
自動定理証明の紹介
自動定理証明の紹介自動定理証明の紹介
自動定理証明の紹介Masahiro Sakai
 
“Adoption and Focus: Practical Linear Types for Imperative Programming”他の紹介@P...
“Adoption and Focus: Practical Linear Types for Imperative Programming”他の紹介@P...“Adoption and Focus: Practical Linear Types for Imperative Programming”他の紹介@P...
“Adoption and Focus: Practical Linear Types for Imperative Programming”他の紹介@P...Masahiro Sakai
 
“Design and Implementation of Generics for the .NET Common Language Runtime”他...
“Design and Implementation of Generics for the .NET Common Language Runtime”他...“Design and Implementation of Generics for the .NET Common Language Runtime”他...
“Design and Implementation of Generics for the .NET Common Language Runtime”他...Masahiro Sakai
 
Relaxed Dependency Analysis
Relaxed Dependency AnalysisRelaxed Dependency Analysis
Relaxed Dependency AnalysisMasahiro Sakai
 
“Symbolic bounds analysis of pointers, array indices, and accessed memory reg...
“Symbolic bounds analysis of pointers, array indices, and accessed memory reg...“Symbolic bounds analysis of pointers, array indices, and accessed memory reg...
“Symbolic bounds analysis of pointers, array indices, and accessed memory reg...Masahiro Sakai
 
自然言語をラムダ式で解釈する体系PTQのHaskell実装
自然言語をラムダ式で解釈する体系PTQのHaskell実装自然言語をラムダ式で解釈する体系PTQのHaskell実装
自然言語をラムダ式で解釈する体系PTQのHaskell実装Masahiro Sakai
 
Whole Program Paths 等の紹介@PLDIr#3
Whole Program Paths 等の紹介@PLDIr#3Whole Program Paths 等の紹介@PLDIr#3
Whole Program Paths 等の紹介@PLDIr#3Masahiro Sakai
 

More from Masahiro Sakai (20)

Towards formal verification of neural networks
Towards formal verification of neural networksTowards formal verification of neural networks
Towards formal verification of neural networks
 
関数プログラマから見たPythonと機械学習
関数プログラマから見たPythonと機械学習関数プログラマから見たPythonと機械学習
関数プログラマから見たPythonと機械学習
 
Writing a SAT solver as a hobby project
Writing a SAT solver as a hobby projectWriting a SAT solver as a hobby project
Writing a SAT solver as a hobby project
 
RClassify: Classifying Race Conditions in Web Applications via Deterministic ...
RClassify: Classifying Race Conditions in Web Applications via Deterministic ...RClassify: Classifying Race Conditions in Web Applications via Deterministic ...
RClassify: Classifying Race Conditions in Web Applications via Deterministic ...
 
ゼロピッチ: MOOC
ゼロピッチ: MOOCゼロピッチ: MOOC
ゼロピッチ: MOOC
 
SAT/SMT solving in Haskell
SAT/SMT solving in HaskellSAT/SMT solving in Haskell
SAT/SMT solving in Haskell
 
SAT/SMTソルバの仕組み
SAT/SMTソルバの仕組みSAT/SMTソルバの仕組み
SAT/SMTソルバの仕組み
 
Introduction to Max-SAT and Max-SAT Evaluation
Introduction to Max-SAT and Max-SAT EvaluationIntroduction to Max-SAT and Max-SAT Evaluation
Introduction to Max-SAT and Max-SAT Evaluation
 
Aluminum: Principled Scenario Exploration through Minimality
Aluminum: Principled Scenario Exploration through MinimalityAluminum: Principled Scenario Exploration through Minimality
Aluminum: Principled Scenario Exploration through Minimality
 
代数的実数とCADの実装紹介
代数的実数とCADの実装紹介代数的実数とCADの実装紹介
代数的実数とCADの実装紹介
 
How a CDCL SAT solver works
How a CDCL SAT solver worksHow a CDCL SAT solver works
How a CDCL SAT solver works
 
Omega test and beyond
Omega test and beyondOmega test and beyond
Omega test and beyond
 
萩野服部研究室 スキー合宿 2012 自己紹介(酒井)
萩野服部研究室 スキー合宿 2012 自己紹介(酒井)萩野服部研究室 スキー合宿 2012 自己紹介(酒井)
萩野服部研究室 スキー合宿 2012 自己紹介(酒井)
 
自動定理証明の紹介
自動定理証明の紹介自動定理証明の紹介
自動定理証明の紹介
 
“Adoption and Focus: Practical Linear Types for Imperative Programming”他の紹介@P...
“Adoption and Focus: Practical Linear Types for Imperative Programming”他の紹介@P...“Adoption and Focus: Practical Linear Types for Imperative Programming”他の紹介@P...
“Adoption and Focus: Practical Linear Types for Imperative Programming”他の紹介@P...
 
“Design and Implementation of Generics for the .NET Common Language Runtime”他...
“Design and Implementation of Generics for the .NET Common Language Runtime”他...“Design and Implementation of Generics for the .NET Common Language Runtime”他...
“Design and Implementation of Generics for the .NET Common Language Runtime”他...
 
Relaxed Dependency Analysis
Relaxed Dependency AnalysisRelaxed Dependency Analysis
Relaxed Dependency Analysis
 
“Symbolic bounds analysis of pointers, array indices, and accessed memory reg...
“Symbolic bounds analysis of pointers, array indices, and accessed memory reg...“Symbolic bounds analysis of pointers, array indices, and accessed memory reg...
“Symbolic bounds analysis of pointers, array indices, and accessed memory reg...
 
自然言語をラムダ式で解釈する体系PTQのHaskell実装
自然言語をラムダ式で解釈する体系PTQのHaskell実装自然言語をラムダ式で解釈する体系PTQのHaskell実装
自然言語をラムダ式で解釈する体系PTQのHaskell実装
 
Whole Program Paths 等の紹介@PLDIr#3
Whole Program Paths 等の紹介@PLDIr#3Whole Program Paths 等の紹介@PLDIr#3
Whole Program Paths 等の紹介@PLDIr#3
 

Haskell - LLRing2006 Language Update