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
110
0
Share
Haskell - A brief introduction
Talk given by Fred van den Driessche on 13-06-2012 at MetaBroadcast.
MetaBroadcast
June 13, 2012
More Decks by MetaBroadcast
See All by MetaBroadcast
PhotoGlut
metabroadcast
2
380
Machine learning: boldly going where Twitter's APIs don't
metabroadcast
0
150
monitoring: it gets better
metabroadcast
1
590
The ABCs of MetaBroadcast APIs
metabroadcast
0
230
APIs for app developers
metabroadcast
1
160
Polishing Varnish
metabroadcast
0
840
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
実践ハーネスエンジニアリング:ステアリングループを実例から読み解く / Practical Harness Engineering: Understanding Steering Loops Through Real-World Examples
nrslib
5
4.4k
運転動画を検索可能にする〜Cosmos-Embed1とDatabricks Vector Searchで〜/cosmos-embed1-databricks-vector-search
studio_graph
1
660
書き換えて学ぶTemporal #fukts
pirosikick
2
360
How We Practice Exploratory Testing in Iterative Development( #scrumniigata ) / 反復開発の中で、探索的テストをどう実施しているか
teyamagu
PRO
3
730
Kubernetesを使わない環境にもCloud Nativeなデプロイを実現する / Enabling Cloud Native deployments without the complexity of Kubernetes
linyows
3
310
属人化しないコード品質の作り方_2026.04.07.pdf
muraaano
0
310
Road to RubyKaigi: Play Hard(ware)
makicamel
1
550
WebAssembly を読み込むベストプラクティス 2026年春版 / Best Practices for Loading WebAssembly (Spring 2026)
petamoriken
5
1.1k
【26新卒研修資料】TDD実装演習
dip_tech
PRO
0
170
🦞OpenClaw works with AWS
licux
1
340
ローカルLLMでどこまでコードが書けるか / How much code can be written on a local LLM
kishida
2
320
when storing skills in S3 file
watany
3
1.4k
Featured
See All Featured
Stewardship and Sustainability of Urban and Community Forests
pwiseman
0
190
JavaScript: Past, Present, and Future - NDC Porto 2020
reverentgeek
52
5.9k
Put a Button on it: Removing Barriers to Going Fast.
kastner
60
4.3k
Easily Structure & Communicate Ideas using Wireframe
afnizarnur
194
17k
Become a Pro
speakerdeck
PRO
31
5.9k
We Analyzed 250 Million AI Search Results: Here's What I Found
joshbly
1
1.3k
Building a Scalable Design System with Sketch
lauravandoore
463
34k
brightonSEO & MeasureFest 2025 - Christian Goodrich - Winning strategies for Black Friday CRO & PPC
cargoodrich
3
690
Future Trends and Review - Lecture 12 - Web Technologies (1019888BNR)
signer
PRO
0
3.5k
Skip the Path - Find Your Career Trail
mkilby
1
120
Conquering PDFs: document understanding beyond plain text
inesmontani
PRO
4
2.7k
ラッコキーワード サービス紹介資料
rakko
1
3.2M
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