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
Socket.io for Haskell folks
Search
Ting-Yen Lai
December 08, 2013
Programming
1.1k
2
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
Socket.io for Haskell folks
Ting-Yen Lai
December 08, 2013
More Decks by Ting-Yen Lai
See All by Ting-Yen Lai
Fuck FINAL
banacorn
0
200
Other Decks in Programming
See All in Programming
Oxlintのカスタムルールの現況
syumai
6
1.1k
メソッドのジェネリクスでGoの夢は広がるか? / Kyoto.go #65
utgwkk
3
840
AIで効率化できた業務・日常
ochtum
0
140
Snowflake Summitでの新機能 CoCo / CoWork / snowflake-summit-2026-overall-what-new-coco
tatsuhiro
1
150
RTSPクライアントを自作してみた話
simotin13
0
610
PHPで使える日時の表現と、その知り方 #frontend_phpcon_do
o0h
PRO
0
260
例外の正しい扱い方 そのエラー try-catchして大丈夫?
jinwatanabe
0
260
The ROI of Quarkus for Spring Boot Applications
hollycummins
0
120
「エンジニアインターン、どうやって取った?」準備のリアルを語るLT会 Progate BAR
akiomatic
0
140
Lemonade + Foundry Toolkit でお手軽アプリ開発
seosoft
1
360
Even G2とAWSで推しのエージェントを召喚しよう!
har1101
1
120
TypeScript+Orvalで実現する型安全かつ堅牢でスケーラブルなマルチチャネル通知基盤 / TSKaigi Night talks ~after conference~
d0riven
0
350
Featured
See All Featured
Embracing the Ebb and Flow
colly
88
5.1k
Measuring Dark Social's Impact On Conversion and Attribution
stephenakadiri
2
220
SEOcharity - Dark patterns in SEO and UX: How to avoid them and build a more ethical web
sarafernandez
0
210
Breaking role norms: Why Content Design is so much more than writing copy - Taylor Woolridge
uxyall
0
320
The Psychology of Web Performance [Beyond Tellerrand 2023]
tammyeverts
49
3.5k
Visualizing Your Data: Incorporating Mongo into Loggly Infrastructure
mongodb
49
10k
Intergalactic Javascript Robots from Outer Space
tanoku
273
27k
B2B Lead Gen: Tactics, Traps & Triumph
marketingsoph
0
160
Responsive Adventures: Dirty Tricks From The Dark Corners of Front-End
smashingmag
254
22k
The Hidden Cost of Media on the Web [PixelPalooza 2025]
tammyeverts
2
330
Crafting Experiences
bethany
1
180
The B2B funnel & how to create a winning content strategy
katarinadahlin
PRO
1
390
Transcript
Socket.IO for Haskell Folks
None
None
None
Real-time Applications
Regular HTTP
Polling
Long-Polling
EventSource
WebSocket
WebSocket
“TCP for the web”
PROS Bi-directional + Full-duplex ! Lower overhead ! Port 80
CONS Not widely supported ! Still a draft*
Socket.IO
asdf
“The cross-browser cross-device WebSocket”
Browser Support IE 5.5+ Safari 2+ Google Chrome 4+ Firefox
3+ Opera 10.61+
Transport Support WebSocket Flash Socket AJAX long polling AJAX multipart
Forever iframe JSONP Polling
socket.emit(‘news’, ‘hey!’); ! ! ! Server
socket.on(‘news’, function (data) { console.log(data); // hey! }); ! Client
socket.emit(‘news’, ‘hey!’); ! socket.on(‘ping’, function () { socket.emit(‘pong’); }); Server
socket.on(‘news’, function (data) { console.log(data); // hey! }); ! socket.emit(‘ping’);
Client
Originated from Node.js
Now also available in many other languages Erlang Java Lua
Python Perl Go C++ C Objective-C Haxe Ruby PHP
Except for Haskell
None
socketio-0.1.0
None
socket.emit(‘news’, ‘hey!’); ! socket.on(‘ping’, function () { socket.emit(‘pong’); });
emit “news” [“hey!”] ! on “ping” $ emit “pong” []
Transport Support WebSocket (80%) Flash Socket AJAX long polling AJAX
multipart Forever iframe JSONP Polling
Difficulties
Transport Support ಠ~ಠ
Transport Support WebSocket Flash Socket AJAX long polling AJAX multipart
Forever iframe JSONP Polling
Transport Support WebSocket Flash Socket AJAX long polling AJAX multipart
Forever iframe JSONP Polling
“Premature optimization is the root of all evil”
Monad Transformers ಠ~ಠ
None
None
! KEEP CALM AND JUST USE IT
None
Iteratee I/O ಠ~ಠ
None
None
None
None
String/Text/ByteString ಠ~ಠ
None
{-# LANGUAGE OverloadedStrings #-}
Open Source Community ಠ~ಠ
None
None
Originated from Node.js
Cabal Hell ಠ~ಠ
> cabal uninstall cabal: unrecognised command: uninstall (try --help)
None
cabal-dev?
LIVE DEMO
None
http://banacorn.org:3000
None
TODO
cabal-dev?
banacorn/socket.io-haskell ! ! ! ALL CONTRIBUTIONS ARE WELCOME!
THANKS! Questions?