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
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
Cloudflare is Agents
chimame
0
170
<title><a id="</title>君はこのHTMLをパースできるか"></a></title> #雑LT_study
pizzacat83
0
150
VibeCodingからAgenticWorkflowへ
starfish719
0
650
in-process GraphQL のすすめ #ginzajs
izumin5210
4
1.4k
freeeにおけるEvalsの実践例の紹介
freee
PRO
0
120
S3 を使うアプリケーションをローカル完結で動かすことに全力を注いでみた / Running S3 Apps Offline
contour_gara
0
540
生成AIで帳票OCRが「簡単に」作れる時代になった?
kon_shou
0
1.1k
仕様駆動開発の消費期限
watany
20
8.7k
いまどきの Codex で開発する visionOS アプリの開発スタイルについて
karad
0
150
仕様駆動開発へのトライを機に チームに適合する手法を模索し続けている話
freee
PRO
0
570
人間の目はかわらない、だからJPEGは30年もつ
yuzneri
12
19k
AWS DevOps AgentのAzure接続機能を検証して見えた活用法/Use Cases Verified for the AWS DevOps Agent's Azure Connectivity Feature
masakiokuda
1
250
Featured
See All Featured
Stewardship and Sustainability of Urban and Community Forests
pwiseman
0
480
Future Trends and Review - Lecture 12 - Web Technologies (1019888BNR)
signer
PRO
0
3.7k
Impact Scores and Hybrid Strategies: The future of link building
tamaranovitovic
0
410
Dominate Local Search Results - an insider guide to GBP, reviews, and Local SEO
greggifford
PRO
0
300
Tips & Tricks on How to Get Your First Job In Tech
honzajavorek
1
700
Site-Speed That Sticks
csswizardry
13
1.4k
30 Presentation Tips
portentint
PRO
1
370
How to Align SEO within the Product Triangle To Get Buy-In & Support - #RIMC
aleyda
2
1.8k
Everyday Curiosity
cassininazir
0
290
Speed Design
sergeychernyshev
33
2k
HTML-Aware ERB: The Path to Reactive Rendering @ RubyCon 2026, Rimini, Italy
marcoroth
3
450
Pawsitive SEO: Lessons from My Dog (and Many Mistakes) on Thriving as a Consultant in the Age of AI
davidcarrasco
0
210
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