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
100
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
140
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
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
Linux Kernelの1文字のミスで 権限昇格ができた話
rqda
0
2.3k
飯MCP
yusukebe
0
480
PHP でエミュレータを自作して Ubuntu を動かそう
m3m0r7
PRO
2
170
今からFlash開発できるわけないじゃん、ムリムリ! (※ムリじゃなかった!?)
arkw
0
180
Redox OS でのネームスペース管理と chroot の実現
isanethen
0
550
Laravel Nightwatchの裏側 - Laravel公式Observabilityツールを支える設計と実装
avosalmon
1
320
GoのDB アクセスにおける 「型安全」と「柔軟性」の両立 - Bob という選択肢
tak848
0
310
Codex CLIのSubagentsによる並列API実装 / Parallel API Implementation with Codex CLI Subagents
takatty
2
850
レガシーPHP転生 〜父がドメインエキスパートだったのでDDD+Claude Codeでチート開発します〜
panda_program
0
440
AIエージェントで業務改善してみた
taku271
0
480
Strategy for Finding a Problem for OSS: With Real Examples
kibitan
0
140
Going Multiplatform with Your Android App (Android Makers 2026)
zsmb
2
340
Featured
See All Featured
Chasing Engaging Ingredients in Design
codingconduct
0
160
What's in a price? How to price your products and services
michaelherold
247
13k
Git: the NoSQL Database
bkeepers
PRO
432
67k
Tell your own story through comics
letsgokoyo
1
880
Navigating Algorithm Shifts & AI Overviews - #SMXNext
aleyda
1
1.2k
Distributed Sagas: A Protocol for Coordinating Microservices
caitiem20
333
22k
Have SEOs Ruined the Internet? - User Awareness of SEO in 2025
akashhashmi
0
310
Producing Creativity
orderedlist
PRO
348
40k
How People are Using Generative and Agentic AI to Supercharge Their Products, Projects, Services and Value Streams Today
helenjbeal
1
150
The #1 spot is gone: here's how to win anyway
tamaranovitovic
2
1k
Claude Code のすすめ
schroneko
67
220k
Creating an realtime collaboration tool: Agile Flush - .NET Oxford
marcduiker
35
2.4k
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