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
120
0
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
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
390
Machine learning: boldly going where Twitter's APIs don't
metabroadcast
0
150
monitoring: it gets better
metabroadcast
1
600
The ABCs of MetaBroadcast APIs
metabroadcast
0
260
APIs for app developers
metabroadcast
1
170
Polishing Varnish
metabroadcast
0
840
Atlas - 3.0 to 4.0
metabroadcast
0
260
Atlas - owl vs deer
metabroadcast
0
260
Storm - an overview
metabroadcast
0
140
Other Decks in Programming
See All in Programming
標準パッケージに uuid が追加された 背景から見る Go らしい意思決定 / go_127_uuid_decision
convto
2
1.4k
DynamoDBの基礎を振り返りながらベクトル検索機能を理解する
musan
3
270
新卒PdEのリアル
ryu1013
1
420
Laravelのアプリケーションをどこにデプロイするか #ツナギメオフライン.9
akase244
0
120
AWS Step Functions 大規模並列の壁を越える / jaws-sonic-2026-niigata-step-functions
kasacchiful
PRO
0
390
ソフトウェアラスタライザ
fadis
1
790
iOS開発×AI駆動開発 〜最近使って便利だったスキルの話〜
nogu66
0
140
Webエンジニアなのにブラウザの仕組みがわからないので、Pythonで自作してみた
tatsuki12
4
1.7k
高専、大学編入、そして未踏へ〜プロダクト開発とキャリアの歩み - Technical College, University Transfer, and On to “Mitou” / My Journey in Product Development and Career
pkmiya
0
140
[GoCon2026] When Goroutines Are Not Enough: Runtime Locality in High-Throughput Go
takehaya
3
380
AIと壁打ちしながら進めるコスト管理
fufuhu
2
1.9k
go-spidermonkeyでAIエージェントのCode Modeを実装する
syumai
3
1.5k
Featured
See All Featured
Between Models and Reality
mayunak
4
450
Into the Great Unknown - MozCon
thekraken
41
2.7k
Efficient Content Optimization with Google Search Console & Apps Script
katarinadahlin
PRO
1
840
GitHub's CSS Performance
jonrohan
1033
470k
Designing for humans not robots
tammielis
254
26k
A designer walks into a library…
pauljervisheath
211
25k
How GitHub (no longer) Works
holman
316
150k
Leadership Guide Workshop - DevTernity 2021
reverentgeek
1
370
The Cost Of JavaScript in 2023
addyosmani
55
10k
Docker and Python
trallard
47
4.2k
How STYLIGHT went responsive
nonsquared
100
6.3k
The Curse of the Amulet
leimatthew05
2
14k
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