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
·
SiteGround - Reliable hosting with speed, security, and support you can count on.
→
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
250
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
광주소프트웨어마이스터고등학교 DevFest 특강 - 바이브 코딩 시대에서 주니어 개발자로 살아남는 방법
utilforever
1
160
komatsuna「分散システムにおけるバグ分析手法」
komatsunaqa
0
130
音楽のための関数型プログラミング言語mimiumにおける多段階計算の活用
tomoyanonymous
1
360
属人化した知識を、 AIが辿れる地図にする
pkshadeck
PRO
1
110
作るコストが小さくなった時代 幸せに働くために改めて考えたいこと 〜エンジニアとして価値を出し続けるために注視している二分野〜
yuppeeng
0
130
壊れたパーサから始める関数型設計と構成的なパーサ #fp_matsuri
raiga0310
2
410
Lean は証明の正しさを確認するためだけのツールって思ってませんか?
inoueasei
1
120
数百円から始めるRuby電子工作
tarosay
0
110
複数の Claude Code が"放置"されてしまう問題をCLI ダッシュボードを自作して解決した話
sumihiro3
0
520
Android CLI
fornewid
0
190
改善しないと、タスクが回らない。 “てんこ盛りポジション” を引き継いだ情シスの、入社3ヶ月の業務改善録
krm963
0
220
信頼性について考えてみる(SRE NEXT 2026 miniLT)
hayama17
0
230
Featured
See All Featured
How to train your dragon (web standard)
notwaldorf
97
6.7k
No one is an island. Learnings from fostering a developers community.
thoeni
21
3.8k
Building an army of robots
kneath
306
46k
How to Build an AI Search Optimization Roadmap - Criteria and Steps to Take #SEOIRL
aleyda
1
2.1k
[SF Ruby Conf 2025] Rails X
palkan
2
1.2k
Put a Button on it: Removing Barriers to Going Fast.
kastner
60
4.5k
Winning Ecommerce Organic Search in an AI Era - #searchnstuff2025
aleyda
1
2.1k
BBQ
matthewcrist
89
10k
Visualization
eitanlees
152
17k
[RailsConf 2023] Rails as a piece of cake
palkan
59
6.8k
For a Future-Friendly Web
brad_frost
183
10k
Utilizing Notion as your number one productivity tool
mfonobong
4
480
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