Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Sign up for free
Menu
Search
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Pricing
Search
Sign in
Sign up for free
Pipes by Example
Search
Nick Partridge
May 09, 2014
Programming
190
1
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
Pipes by Example
Presented to YOW! Lambda Jam 2014.
Nick Partridge
May 09, 2014
Transcript
22 slides
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
Other Decks in Programming
See All in Programming
AppFunctionsの内部実装を紐解く
hiroaki404
1
120
SODA - FACT BOOK(EN)
sodainc
1
290
AI駆動TDD ― 2026年10月版
hrmstrsmgs
0
110
Distance field of Julia set
kinakomoti321
0
330
どうしても Eloquent でリポジトリパターンをやりたいんだ #phpcon_niigata / phpcon-niigata-2026
shogogg
0
690
Jujutsu で毎日のバージョン管理に「安心」と「直感性」を
oukayuka
0
110
Claude Codeのおかげでやりたいことがやれるようになったんだよォー!
sms_tech
0
190
Engineering Biometric UX Across Android Versions | DroidKnights 2026
ryunen344
1
220
SONY CISC-NEWS NWS-1750 + NWB-225 ハードウェアメンテとフレームバッファカラー対応 / KOF2026
tsutsui
0
150
Getting Started with Vibe Coding
miccheng
0
250
高橋メソッドでCVE解説シリーズ 〜CVE-2026-112816〜
hakkadaikon
0
280
Enforcing Your Architecture with Unit Tests in the AI Era (Swift Connection X)
steliosf
PRO
1
200
Featured
See All Featured
Ruling the World: When Life Gets Gamed
codingconduct
0
450
RailsConf & Balkan Ruby 2019: The Past, Present, and Future of Rails at GitHub
eileencodes
141
35k
How To Speak Unicorn (iThemes Webinar)
marktimemedia
1
650
Design in an AI World
tapps
1
400
Chasing Engaging Ingredients in Design
codingconduct
0
410
The Director’s Chair: Orchestrating AI for Truly Effective Learning
tmiket
1
360
Ten Tips & Tricks for a 🌱 transition
stuffmc
1
290
Reality Check: Gamification 10 Years Later
codingconduct
0
2.4k
Paper Plane
katiecoart
PRO
6
55k
Code Reviewing Like a Champion
maltzj
529
40k
How to make the Groovebox
asonas
2
2.6k
Bootstrapping a Software Product
garrettdimon
PRO
306
120k