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
React-Haskell
Search
Joel Burget
November 19, 2014
Programming
3
420
React-Haskell
Khan Academy dev standup presentation.
https://github.com/joelburget/react-haskell
Joel Burget
November 19, 2014
Tweet
Share
More Decks by Joel Burget
See All by Joel Burget
Backbone to React
joelburget
24
67k
Other Decks in Programming
See All in Programming
What Spring Developers Should Know About Jakarta EE
ivargrimstad
0
580
NIKKEI Tech Talk#38
cipepser
0
320
CSC509 Lecture 08
javiergs
PRO
0
270
Cursorハンズオン実践!
eltociear
2
1.2k
実践Claude Code:20の失敗から学ぶAIペアプログラミング
takedatakashi
18
9.1k
あなたとKaigi on Rails / Kaigi on Rails + You
shimoju
0
220
はじめてのDSPy - 言語モデルを『プロンプト』ではなく『プログラミング』するための仕組み
masahiro_nishimi
4
17k
開発組織の戦略的な役割と 設計スキル向上の効果
masuda220
PRO
10
1.8k
AkarengaLT vol.38
hashimoto_kei
1
130
コードとあなたと私の距離 / The Distance Between Code, You, and I
hiro_y
0
210
ネストしたdata classの面倒な更新にさようなら!Lensを作って理解するArrowのOpticsの世界
shiita0903
1
160
Ktorで簡単AIアプリケーション
tsukakei
0
120
Featured
See All Featured
A Modern Web Designer's Workflow
chriscoyier
697
190k
CSS Pre-Processors: Stylus, Less & Sass
bermonpainter
359
30k
XXLCSS - How to scale CSS and keep your sanity
sugarenia
249
1.3M
RailsConf 2023
tenderlove
30
1.3k
Chrome DevTools: State of the Union 2024 - Debugging React & Beyond
addyosmani
9
940
Art, The Web, and Tiny UX
lynnandtonic
303
21k
CoffeeScript is Beautiful & I Never Want to Write Plain JavaScript Again
sstephenson
162
15k
How GitHub (no longer) Works
holman
315
140k
Improving Core Web Vitals using Speculation Rules API
sergeychernyshev
21
1.2k
Reflections from 52 weeks, 52 projects
jeffersonlam
355
21k
Imperfection Machines: The Place of Print at Facebook
scottboms
269
13k
Statistics for Hackers
jakevdp
799
220k
Transcript
None
REACT-HASKELL
HI, MY NAME IS JOEL
HI, MY NAME IS JOEL ... AND I USE HASKELL
HASKELL ▸ statically typed ▸ lazy ▸ purely functional
HASKELL ▸ statically typed ▸ lazy ▸ purely functional ▸
really cool
HASTE ▸ dialect of Haskell ▸ runs in browser
HASTE
BLAZE-HTML sample :: Html sample = p ! class_ "styled"
$ em "Basic Algebra" becomes <p class="styled"> <em>Basic Algebra</em> </p>
REACT-HASKELL sample :: React sample = p <! className "styled"
$ em "Basic Algebra" becomes <p class="styled"> <em>Basic Algebra</em> </p>
PUT IT ON THE PAGE main :: IO () main
= do Just elem <- elemById "id" render elem sample
MORE COMPLICATED sample :: React sample = div <! className
"beautify" $ do "Khan Academy" input "Rewritten in Haskell"
CONTROLLED COMPONENT view :: Elem -> JSString -> IO ()
view elem str = render elem $ div $ do "Khan Academy" input <! onChange (view elem . targetValue) text str
None
LET'S MAKE THAT EASIER
STATEFUL COMPONENT REDUX view :: StatefulReact JSString view = div
$ do "Khan Academy" input <! onChange' (updateState . targetValue) text str
LIFECYCLE METHODS componentDidMount, componentWillUnmount, ... ?
QUESTIONS?