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
Pipes by Example
Search
Sponsored
·
SiteGround - Reliable hosting with speed, security, and support you can count on.
→
Nick Partridge
May 09, 2014
Programming
1
180
Pipes by Example
Presented to YOW! Lambda Jam 2014.
Nick Partridge
May 09, 2014
Tweet
Share
Other Decks in Programming
See All in Programming
AI & Enginnering
codelynx
0
110
疑似コードによるプロンプト記述、どのくらい正確に実行される?
kokuyouwind
0
380
メルカリのリーダビリティチームが取り組む、AI時代のスケーラブルな品質文化
cloverrose
2
510
FOSDEM 2026: STUNMESH-go: Building P2P WireGuard Mesh Without Self-Hosted Infrastructure
tjjh89017
0
150
360° Signals in Angular: Signal Forms with SignalStore & Resources @ngLondon 01/2026
manfredsteyer
PRO
0
120
今こそ知るべき耐量子計算機暗号(PQC)入門 / PQC: What You Need to Know Now
mackey0225
3
370
16年目のピクシブ百科事典を支える最新の技術基盤 / The Modern Tech Stack Powering Pixiv Encyclopedia in its 16th Year
ahuglajbclajep
5
990
MDN Web Docs に日本語翻訳でコントリビュート
ohmori_yusuke
0
640
IFSによる形状設計/デモシーンの魅力 @ 慶應大学SFC
gam0022
1
300
AIによるイベントストーミング図からのコード生成 / AI-powered code generation from Event Storming diagrams
nrslib
2
1.8k
AI によるインシデント初動調査の自動化を行う AI インシデントコマンダーを作った話
azukiazusa1
1
690
Basic Architectures
denyspoltorak
0
660
Featured
See All Featured
brightonSEO & MeasureFest 2025 - Christian Goodrich - Winning strategies for Black Friday CRO & PPC
cargoodrich
3
97
Stop Working from a Prison Cell
hatefulcrawdad
273
21k
HU Berlin: Industrial-Strength Natural Language Processing with spaCy and Prodigy
inesmontani
PRO
0
200
Into the Great Unknown - MozCon
thekraken
40
2.2k
How to Think Like a Performance Engineer
csswizardry
28
2.4k
Self-Hosted WebAssembly Runtime for Runtime-Neutral Checkpoint/Restore in Edge–Cloud Continuum
chikuwait
0
320
Navigating Algorithm Shifts & AI Overviews - #SMXNext
aleyda
0
1.1k
Exploring the relationship between traditional SERPs and Gen AI search
raygrieselhuber
PRO
2
3.6k
Designing Experiences People Love
moore
144
24k
Music & Morning Musume
bryan
47
7.1k
Ten Tips & Tricks for a 🌱 transition
stuffmc
0
64
Claude Code のすすめ
schroneko
67
210k
Transcript
Pipes by Example Nick Partridge. nkpart on most things.
Why Pipes Because you’re writing a web server, of course.
Not just for streaming! produce :: m a consume ::
a -> m ()
Pipe Types Lead, PVC, etc.
Producers Consumers + Pipes Proxy a a’ b b’ m
c
Pipe a b m r a b m On exhaustion:
r Proxy () a () b m r
Producer b m r _ b m On exhaustion: r
Proxy X () () b m r
Consumer a m r a _ m On exhaustion: r
Proxy () a () X m r
The Primitives Because live coding always works.
Use the Monad Running producers sequentially is just >> When
pipes/consumers/producers/finish, they return a value Control.Monad and friends are very useful.
Elimination Finally some Category Theory.
Pipe a b m r a b m On exhaustion:
r
Effect m r m On exhaustion: r _ _ Proxy
X () () X m r
Substitution Producers: for or ~> eliminates yield Consumer side: >~
eliminates await
Elimination - Loop Bodies for generator body ! for x
yield == x for (yield x) f == f x
Companion Libraries Where the features are hiding.
Companion Libraries pipes-parse pipes-safe pipes-group
1. Pipes Parse type Parser a m r = forall
x. StateT (Producer a m x) m r Provides ‘push-back’. You can modify the underlying producer to return a value again.
2. Pipes Safe ReaderT (IORef (Finalizers m)) m r Resource
management, exception safety, through a monad transformer on m that allows registering Finalizers.
3. Pipes Group FreeT (Producer a m) m x Working
on sub-streams in constant memory. a ‘linked-list’ of sub-stream producers, each one returning the next sub-stream on exhaustion
return () :: Effect Talk ()
References Pipes haddocks - Pipes, Pipes.Prelude, Pipes.Tutorial Haskell for All
- Gabriel Gonzales’ blog Haskell Pipes Google Group “pipes-“ seach on hackage