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
slamdata/purescript-halogen の紹介
Search
e_ntyo
November 25, 2018
Programming
0
130
slamdata/purescript-halogen の紹介
HTML5 Conference 2018の公募LTで発表させていただきました。
e_ntyo
November 25, 2018
Tweet
Share
More Decks by e_ntyo
See All by e_ntyo
論文紹介 "My Mouse, My Rules - Privacy Issues of Behavioral User Profiling via Mouse Tracking"
e_ntyo
1
150
論文紹介 - Towards Memorable Information Retrieval (ICTIR ‘20)
e_ntyo
0
64
Introducing Type Providers
e_ntyo
0
17k
セーフティ・JavaScript・プログラミング
e_ntyo
0
230
Other Decks in Programming
See All in Programming
はじめてのカスタムエージェント【GitHub Copilot Agent Mode編】
satoshi256kbyte
0
110
クラウドに依存しないS3を使った開発術
simesaba80
0
180
新卒エンジニアのプルリクエスト with AI駆動
fukunaga2025
0
240
Combinatorial Interview Problems with Backtracking Solutions - From Imperative Procedural Programming to Declarative Functional Programming - Part 2
philipschwarz
PRO
0
120
DevFest Android in Korea 2025 - 개발자 커뮤니티를 통해 얻는 가치
wisemuji
0
180
ローカルLLMを⽤いてコード補完を⾏う VSCode拡張機能を作ってみた
nearme_tech
PRO
0
200
AIの誤りが許されない業務システムにおいて“信頼されるAI” を目指す / building-trusted-ai-systems
yuya4
6
4k
AIコーディングエージェント(Gemini)
kondai24
0
300
tparseでgo testの出力を見やすくする
utgwkk
2
310
AI Agent Dojo #4: watsonx Orchestrate ADK体験
oniak3ibm
PRO
0
110
JETLS.jl ─ A New Language Server for Julia
abap34
2
460
Navigating Dependency Injection with Metro
l2hyunwoo
1
200
Featured
See All Featured
Visualizing Your Data: Incorporating Mongo into Loggly Infrastructure
mongodb
48
9.8k
GitHub's CSS Performance
jonrohan
1032
470k
AI Search: Where Are We & What Can We Do About It?
aleyda
0
6.8k
The Language of Interfaces
destraynor
162
26k
Deep Space Network (abreviated)
tonyrice
0
27
Designing for Performance
lara
610
70k
How To Speak Unicorn (iThemes Webinar)
marktimemedia
1
350
Un-Boring Meetings
codingconduct
0
170
10 Git Anti Patterns You Should be Aware of
lemiorhan
PRO
659
61k
16th Malabo Montpellier Forum Presentation
akademiya2063
PRO
0
32
Game over? The fight for quality and originality in the time of robots
wayneb77
1
67
Building the Perfect Custom Keyboard
takai
1
660
Transcript
slamdata/purescript-halogen の紹介 @e_ntyo (https://entyo.github.io)
@e_ntyo • 大学中退 → フリーター • もうすぐ誕生日 ◦ ほしいものリスト
このスライドの内容 1. そもそもPureScriptとは 2. slmadata/purescript-halogen というUIライブラリの紹介
PureScriptを 知っている方
PureScriptとは • いわゆるAltJSの1つ .purs .js compile by psc .js use
via FFI
PureScriptとは • Haskellライクな関数型プログラミング言語 ◦ 静的型による強力な型システム ▪ 型クラス, パターンマッチ, Record型, などの超便利機能
▪ 開発者支援 • コードの自動生成 • エディタでのコード補完・定義ジャンプ
PureScriptとは • Haskellライクな関数型プログラミング言語 ◦ 圏論の世界の概念を利用できる ▪ Functor, Monoid → リスト操作が便利に
▪ Applicative → フォームバリデーションが簡単に ▪ Monad → 副作用を持つ値, Nullableな値の取扱が安全に 重要: 圏論での意味合いがわかっていなくても使える(こわくない)
slamdata/purescript-halogen • VDOMを利用したPureScriptのUIライブラリ ◦ コンポーネントツリーで UIを組み立てる ▪ 個人的な印象: PureScriptの世界線でのReact.js •
React.jsのバインディングも存在
slamdata/purescript-halogen • 例 - entyo/WatchingU
slamdata/purescript-halogen • 例 - entyo/WatchingU
slamdata/purescript-halogen • 例 - コンポーネントの定義
slamdata/purescript-halogen • 例 - コンポーネントの構成要素
slamdata/purescript-halogen • 例 - コンポーネントの構成要素
slamdata/purescript-halogen • 例 - コンポーネントの動作
slamdata/purescript-halogen • 例 - コンポーネントの動作
slamdata/purescript-halogen • 例 - State -> View
slamdata/purescript-halogen • 例 - State -> View
None
SPAをつくるぞ! • Global Stateの管理はどうするの? ◦ ReaderTパターン を使うとよさそう ◦ 参考: vladciobanu/purescript-halogen-example
SPAをつくるぞ! • 〇〇はできますか? ◦ Routerは? ▪ ある ◦ Server Side
Renderingは? ▪ 未対応(対応している 別のUIライブラリはある) ◦ SVG Supportは? ▪ actively developmentが終了
まとめ • PureScript → HaskellライクなAltJS ◦ 最新の関数型プログラミング言語 ◦ 既存のJSのコードは再利用できる •
purescript-halogen → VDOMを利用したPureScriptのUIライブラリ ◦ 安全な(ランタイムエラーのない) SPAを開発できる
See Also • entyo/WatchingU • コモナドスケッチ ~ 1. DOMのコラージュ ~
◦ PureScriptでSPAを書いていく連載記事