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
·
Your Podcast. Everywhere. Effortlessly.
Share. Educate. Inspire. Entertain. You do you. We'll handle the rest.
→
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
クラウドネイティブなエンジニアに向ける Raycastの魅力と実際の活用事例
nealle
2
240
My daily life on Ruby
a_matsuda
3
180
Augmenting AI with the Power of Jakarta EE
ivargrimstad
0
190
Claude Code × Gemini × Ebitengine ゲーム制作素人WebエンジニアがGoでゲームを作った話
webzawa
0
220
10 Tips of AWS ~Gen AI on AWS~
licux
5
540
KMP × Kotlin 2.3 - How Android Got Slower While iOS Builds Improved by 47%
rio432
0
130
【26新卒研修資料】TDD実装演習
dip_tech
PRO
0
170
〜バイブコーディングを超えて〜 チームで実験し続けたAI駆動開発
tigertora7571
0
190
Vibe NLP for Applied NLP
inesmontani
PRO
0
610
Liberating Ruby's Parser from Lexer Hacks
ydah
2
2.6k
実践ハーネスエンジニアリング:ステアリングループを実例から読み解く / Practical Harness Engineering: Understanding Steering Loops Through Real-World Examples
nrslib
5
4.1k
AIベース静的検査器の偽陽性率を抑える工夫3選
orgachem
PRO
4
450
Featured
See All Featured
How To Speak Unicorn (iThemes Webinar)
marktimemedia
1
450
It's Worth the Effort
3n
188
29k
The State of eCommerce SEO: How to Win in Today's Products SERPs - #SEOweek
aleyda
2
10k
Building Applications with DynamoDB
mza
96
7k
Building an army of robots
kneath
306
46k
Accessibility Awareness
sabderemane
1
110
Evolving SEO for Evolving Search Engines
ryanjones
0
190
Easily Structure & Communicate Ideas using Wireframe
afnizarnur
194
17k
I Don’t Have Time: Getting Over the Fear to Launch Your Podcast
jcasabona
34
2.7k
Prompt Engineering for Job Search
mfonobong
0
290
How to Ace a Technical Interview
jacobian
281
24k
The Mindset for Success: Future Career Progression
greggifford
PRO
0
320
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