Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
Haskell - A brief introduction
Search
Sponsored
·
Ship Features Fearlessly
Turn features on and off without deploys. Used by thousands of Ruby developers.
→
MetaBroadcast
June 13, 2012
Programming
0
99
Haskell - A brief introduction
Talk given by Fred van den Driessche on 13-06-2012 at MetaBroadcast.
MetaBroadcast
June 13, 2012
Tweet
Share
More Decks by MetaBroadcast
See All by MetaBroadcast
PhotoGlut
metabroadcast
2
380
Machine learning: boldly going where Twitter's APIs don't
metabroadcast
0
140
monitoring: it gets better
metabroadcast
1
590
The ABCs of MetaBroadcast APIs
metabroadcast
0
220
APIs for app developers
metabroadcast
1
160
Polishing Varnish
metabroadcast
0
830
Atlas - 3.0 to 4.0
metabroadcast
0
250
Atlas - owl vs deer
metabroadcast
0
250
Storm - an overview
metabroadcast
0
130
Other Decks in Programming
See All in Programming
技術検証結果の整理と解析をAIに任せよう!
keisukeikeda
0
130
The free-lunch guide to idea circularity
hollycummins
0
320
Claude Codeログ基盤の構築
giginet
PRO
7
3.5k
The Past, Present, and Future of Enterprise Java
ivargrimstad
0
790
最初からAWS CDKで技術検証してもいいんじゃない?
akihisaikeda
4
160
メッセージングを利用して時間的結合を分離しよう #phperkaigi
kajitack
3
280
20260313 - Grafana & Friends Taipei #1 - Kubernetes v1.36 的開發雜記:那些困在 Alpha 加護病房太久的 Metrics
tico88612
0
230
メタプログラミングで実現する「コードを仕様にする」仕組み/nikkei-tech-talk43
nikkei_engineer_recruiting
0
210
エンジニアの「手元の自動化」を加速するn8n 2026.02.27
symy2co
0
170
ベクトル検索のフィルタを用いた機械学習モデルとの統合 / python-meetup-fukuoka-06-vector-attr
monochromegane
2
500
Claude Code Skill入門
mayahoney
0
410
PHPで TLSのプロトコルを実装してみる
higaki_program
0
380
Featured
See All Featured
What the history of the web can teach us about the future of AI
inesmontani
PRO
1
480
A designer walks into a library…
pauljervisheath
210
24k
AI in Enterprises - Java and Open Source to the Rescue
ivargrimstad
0
1.2k
Six Lessons from altMBA
skipperchong
29
4.2k
Testing 201, or: Great Expectations
jmmastey
46
8.1k
My Coaching Mixtape
mlcsv
0
83
Music & Morning Musume
bryan
47
7.1k
Impact Scores and Hybrid Strategies: The future of link building
tamaranovitovic
0
240
Art, The Web, and Tiny UX
lynnandtonic
304
21k
Context Engineering - Making Every Token Count
addyosmani
9
770
Optimizing for Happiness
mojombo
378
71k
Easily Structure & Communicate Ideas using Wireframe
afnizarnur
194
17k
Transcript
Haskell A Brief Introduction
Pure Functional Lists Lazy • • •
Built-in Types Numbers: 1, 1.234 Booleans: True, False Characters/Strings: 'a',
"asdf" Lists: [1,2,3] Tuples:("jim", 25) • • • • •
Functions double x = 2 * x > double 5
10
Control max x y = if x > y then
x else y max x y | x > y = x | otherwise y
Lists [] 1 : [2, 3] = [1, 2, 3]
[1, 2] ++ [3, 4] = [1, 2, 3, 4] head [1, 2, 3] = 1 tail [1, 2, 3] = [2, 3]g • • • • •
Pattern Matching dblAll [] = [] dblAll (x:xs)= double x
: dblAll xs
Higher-order functions > map double [1, 2, 3] [2, 4,
6] map f [] = [] map f (x:xs) = f x : map f xs
Function Types > :t double double :: Num a =>
a -> a > :t (*) (*) :: Num a => a -> a -> a > :t map map :: (a -> b) -> [a] -> [b]
Currying > :t (*) (*) :: Num a => a
-> a -> a > :t (2*) (2*) :: Num a => a -> a double = 2* dblAll = map (2*)
Data Types data Bool = True | False data Maybe
a = Just a | Nothing data Either a b = Left a | Right b data Tree a = Empty | Node a (Tree a) (Tree b ) • • • •
yesOrNo True = "yes" yesOrNo False = "no" traverse Empty
= [] traverse (Node v l r) = (traverse l) ++ v : traverse r
Laziness fib c n = c : fib n (c
+ n) > fib 0 1 [0, 1, 1, 2, 3, 5, 8, 13, 21 ... > take 5 (fib 0 1) [0, 1, 1, 2, 3]
Laziness > (fib 0 1) !! 900 54877108839480000051413673948383714443800