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
MetaBroadcast
June 13, 2012
Programming
0
89
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
370
Machine learning: boldly going where Twitter's APIs don't
metabroadcast
0
130
monitoring: it gets better
metabroadcast
1
570
The ABCs of MetaBroadcast APIs
metabroadcast
0
210
APIs for app developers
metabroadcast
1
150
Polishing Varnish
metabroadcast
0
830
Atlas - 3.0 to 4.0
metabroadcast
0
240
Atlas - owl vs deer
metabroadcast
0
250
Storm - an overview
metabroadcast
0
130
Other Decks in Programming
See All in Programming
最新のDirectX12で使えるレイトレ周りの機能追加について
projectasura
0
300
[堅牢.py #1] テストを書かない研究者に送る、最初にテストを書く実験コード入門 / Let's start your ML project by writing tests
shunk031
11
5.7k
Building AI Agents with TypeScript #TSKaigiHokuriku
izumin5210
5
990
Agentに至る道 〜なぜLLMは自動でコードを書けるようになったのか〜
mackee
5
1.9k
FlutterKaigi 2025 システム裏側
yumnumm
0
1.2k
DartASTとその活用
sotaatos
2
150
「正規表現をつくる」をつくる / make "make regex"
makenowjust
1
750
AWS CDKの推しポイントN選
akihisaikeda
1
160
ソフトウェア設計の課題・原則・実践技法
masuda220
PRO
21
16k
JJUG CCC 2025 Fall: Virtual Thread Deep Dive
ternbusty
3
480
connect-python: convenient protobuf RPC for Python
anuraaga
0
210
関数の挙動書き換える
takatofukui
4
750
Featured
See All Featured
Into the Great Unknown - MozCon
thekraken
40
2.2k
Put a Button on it: Removing Barriers to Going Fast.
kastner
60
4.1k
Site-Speed That Sticks
csswizardry
13
970
Documentation Writing (for coders)
carmenintech
76
5.1k
Automating Front-end Workflow
addyosmani
1371
200k
Easily Structure & Communicate Ideas using Wireframe
afnizarnur
194
17k
jQuery: Nuts, Bolts and Bling
dougneiner
65
8k
How to Create Impact in a Changing Tech Landscape [PerfNow 2023]
tammyeverts
55
3.1k
Rails Girls Zürich Keynote
gr2m
95
14k
Helping Users Find Their Own Way: Creating Modern Search Experiences
danielanewman
31
3k
The Hidden Cost of Media on the Web [PixelPalooza 2025]
tammyeverts
1
46
個人開発の失敗を避けるイケてる考え方 / tips for indie hackers
panda_program
118
20k
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