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
The reason for using reason
Search
mzp
July 22, 2017
Technology
3k
2
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
The reason for using reason
https://ml-lang.connpass.com/event/58151/
mzp
July 22, 2017
More Decks by mzp
See All by mzp
アイドルとして勤務する -理論と実践- / Work as cute idol. - theory & practice - #imas_hack
mzp
2
18k
日本語入力の落とし穴
mzp
4
14k
アイマスハッカソン 2017-ライブの感動を再現する
mzp
1
2.5k
ぺろぺろ - Github pull request bot framework -
mzp
2
3.4k
Love💕LivePhotos
mzp
0
1.6k
日本語入力とLisp
mzp
1
3.6k
Amazon EC2 スポットインスタンスを開発環境にする話
mzp
0
1.6k
クラウドサービスを活用した開発環境
mzp
1
3.4k
Rubyistのための型入門
mzp
19
6.2k
Other Decks in Technology
See All in Technology
Von-Neumann Machines, Dreams & The Futures of IT
ufried
0
110
JSONataとAWS Step Functionsで目指すRuntimelessな世界
mu7889yoon
0
290
CLIライブラリ開発を支える技術
htnabe
0
140
Slack上でインフラをトラブルシュートする! Agentic Platform Engineeringの第一歩
teru0x1
5
1.8k
アプリをもっと"iOSアプリっぽく"する小さな工夫 / Small Touches That Make Your App Feel More Like an iOS App
matsuji
2
970
現場で役立つ技術負債の効果的な返済方法
masuda220
PRO
9
4.7k
顧客に向き合う開発組織へ。リアーキテクチャとフィーチャーチーム化で挑む組織改革
safie
0
2.1k
ソフトウェアDNAとクラウドエージェントのススメ
cloudace
0
120
おい、エージェントを使って終わらせろ
nwiizo
2
760
「ピッケル本」日本語版は4.0(第6版)が出版されるべき / pickaxe4-nagoyark05
kakutani
2
220
俺の仕事は AIに奪われないし、たぶんその BIも要らない
hikaruri
0
520
AIエージェントの自己改善をどう設計するか / How to Design Self-Improvement for AI Agents
22mi
25
16k
Featured
See All Featured
I Don’t Have Time: Getting Over the Fear to Launch Your Podcast
jcasabona
35
2.8k
Let's Do A Bunch of Simple Stuff to Make Websites Faster
chriscoyier
508
140k
Leo the Paperboy
mayatellez
10
2.3k
Chasing Engaging Ingredients in Design
codingconduct
0
320
Large-scale JavaScript Application Architecture
addyosmani
515
110k
Impact Scores and Hybrid Strategies: The future of link building
tamaranovitovic
0
440
Writing Fast Ruby
sferik
630
63k
Navigating the moral maze — ethical principles for Al-driven product design
skipperchong
2
550
JAMstack: Web Apps at Ludicrous Speed - All Things Open 2022
reverentgeek
1
600
Digital Ethics as a Driver of Design Innovation
axbom
PRO
1
430
What the history of the web can teach us about the future of AI
inesmontani
PRO
1
700
DevOps and Value Stream Thinking: Enabling flow, efficiency and business value
helenjbeal
1
390
Transcript
5IFSFBTPOGPSVTJOHSFBTPO N[Q .-ษڧձ
ཁ .PEFSO+BWB4DSJQU❤.-GFBUVSFT Ͱಋೖେม 0$BNMΛ+BWB4DSJQUͬΆ͘͠Α͏
None
Ҿ༻ݩ3*05"3FBDUMJLFVTFSJOUFSGBDFNJDSPMJCSBSZ IUUQNJLFXBSEOFUUBMLSJPUKT
None
class Greeting extends React.Component { render() { return <h1>Hello</h1>; }
} 3FBDUWJFXͷߏங
3FEVYঢ়ଶཧ ભҠؔΛఆٛ͠ঢ়ଶΛཧ͢Δ ͜ͷؔΛSFEVDFSΛݺͿ state -> action -> state
function counter(state = 0, action) { switch (action.type) { case
'INCREMENT': return state + 1 case 'DECREMENT': return state - 1 default: return state } } ྫDPVOUFSSFEVDFS { type: "INCREMENTAL" }
function todo(state, action) { switch (action.type) { case 'TOGGLE': if(state.id
== action.id) { return {...state , completed: !state.completed } } else { return state } default: return state } } ྫUPEPSFEVDFS { type: 'TOGGLE', id: 42 } { id: 42, name: "create slide", completed: false, ... }
SFEVDFSJEJPN UZQF͕Yͷͱ͖ɺZͱ͍͏߲Λ࣋ͭ ঢ়ଶΛίϐʔ͠ɺҰ෦͚ͩߋ৽͢Δ ˠόϦΞϯτܕͬΆ͍ ˠϨίʔυܕͬΆ͍
.-༝དྷͷػೳͷಋೖ ύλʔϯϚον .BZCFϞφυ ඇಉظϞφυ ੩తܕݕࠪ
+ 2016 Ҿ༻ݩ5IF%BXOPG3FBTPO IUUQTTBOEFSTQJFTHJUIVCJPTMJEFTEBXOPGSFBTPOQEG
✨ཧͷݴޠ✨ όϦΞϯτϨίʔυܕ͕͋Δ ύλʔϯϚον͕͋Δ ੩తܕݕ͕ࠪ͋Δ +BWB4DSJQU͕ੜͰ͖Δ
JS developer trying to grasp OCaml syntax Ҿ༻ݩ5IF%BXOPG3FBTPO IUUQTTBOEFSTQJFTHJUIVCJPTMJEFTEBXOPGSFBTPOQEG
JavaScript OCaml Flow Reason Adopting features of ML Becoming familiar
to JS developers Syntax + tooling A lot of work Ҿ༻ݩ5IF%BXOPG3FBTPO IUUQTTBOEFSTQJFTHJUIVCJPTMJEFTEBXOPGSFBTPOQEG
3FBTPO͕ͬͯΔ͜ͱ
#VDLMF4DSJQUͱͷ࿈ܞ 0$BNM͔Β+BWB4DSJQUΛੜ͢ΔίϯύΠϥ IUUQHJUIVCDPNCMPPNCFSHCVDLMFTDSJQU function fact(n) { if (n !== 0)
{ return imul(n, fact(n - 1 | 0)); } else { return 1; } } let rec fact = function | 0 -> 1 | n -> n * fact (n - 1) 0$BNM +BWB4DSJQU
'use strict'; var Pervasives = require("bs-platform/lib/js/pervasives"); var Http = require("http");
var hostname = "127.0.0.1"; function create_server(http) { var server = http.createServer(function (_, resp) { resp.statusCode = 200; resp.setHeader("Content-Type", "text/plain"); return resp.end("Hello world\n"); }); return server.listen(3000, hostname, function () { console.log("Server running at http://" + (hostname + (":" + (Pervasives.string_of_int(3000) + "/")))); return /* () */0; }); } create_server(Http); IVNBOSFBEBCMFDPEF
Ҿ༻ݩ0$BNM+BWBTDSJQU IUUQTHJUIVCDPN#VDLMF4DSJQUCVDLMFTDSJQUCMPCNBTUFSEPDTTMJEFT#VDLMF@NFFUVQNE
let greeting = "hello!"; let name = "mzp"; ..... จ๏มଋറ
if (showMenu) { displayMenu (); }; จ๏݅ذ
switch data { | GoodResult theMessage => "Success! " ^
theMessage | BadResult errorCode => "Something's wrong. The error code is: " ^ (string_of_int errorCode) }; จ๏ύλʔϯϚον
ύοέʔδϚωʔδϟʔ OQNΛར༻͢Δ PQBNΘͳ͍ OQNJOTUBMMCTQMBUGPSNͰ0$BNMͷϏ ϧυ͕࢝·Δ
ίʔυิNFSMJO
ΤσΟλ֦ு
#FUUFS&SSPST Ҿ༻ݩIUUQTHJUIVCDPNSFBTPONM#FUUFS&SSPST
SFE Ҿ༻ݩIUUQTHJUIVCDPNSFBTPONMSFE
༨ஊ3FBTPOͱ͍͏໊લ ؔ࿈ϓϩμΫτ͕શ෦Ұൠ໊ࢺ qPX JOGFS SFBTPO FYBNQMFʹSFBTPOPGMJGF͕͋Δ
3FBTPOͷར༻ྫ
IUUQTUXJUUFSDPNMPZPMOZTUBUVT 'BDFCPPL.FTTBOHFSͷ 3FBTPOʹஔ͖͑ΒΕͯΔ
Meanwhile at… Concurrent React Prototype in OCaml @jordwalke Ҿ༻ݩ5IF%BXOPG3FBTPO IUUQTTBOEFSTQJFTHJUIVCJPTMJEFTEBXOPGSFBTPOQEG
None
3FBTPOͷΑ͍໘
let redux state = function | `Toggle id -> if
state.id = id then { state with complete=not state.complete } else state | _ -> state ύλʔϯϚον࠷ߴ
Ϗϧυ
let maybeSay (s: string Js.null) = Js.Null.iter s (fun message
-> Js.log message) let maybeSay (s: string Js.undefined) = Js.Undefined.iter s (fun message -> Js.log message) OVMMVOEFpOFE
take_if context ~f:(function `DelayedInc -> Some () | _ ->
None) >>= (fun () -> call (delay 1000)) >>= (fun () -> put context `Inc) DBMMCBDLIFMM
3FBTPOͷͭΒ͍໘
Πϯετʔϧ࣌ؒͷ૿Ճ
external request : config -> response Js.Promise.t = "get" [@@bs.module
"axios"]; external get : string -> config Js.null -> response Js.Promise.t = "get" [@@bs.module "axios"]; external delete: string -> config Js.null -> response Js.Promise.t = "delete" [@@bs.module "axios"]; external head: string -> config Js.null -> response Js.Promise.t = "head" [@@bs.module "axios"]; external post: string -> 'a Js.null -> config Js.null -> response Js.Promise.t = "post" [@@bs.module "axios"]; external put: string -> config Js.null -> response Js.Promise.t = "put" [@@bs.module "axios"]; external patch: string -> config Js.null -> response Js.Promise.t = "patch" [@@bs.module "axios"]; ܕఆ͕ٛେม
let expect_array json = switch (Js.Json.reifyType json) { | Js.Json.Array,
data -> swtich (Js.Json.reifyType data) { ... } | _ -> failwith "unexpected response type" } +40/͔ΒͷσʔλऔΓग़͠
type tree = | Leaf | Node of int *
tree * tree (* Leaf --> 0 *) (* Node(a,b,c) --> [a,b,c]*) όϦΞϯτͷϥϯλΠϜදݱ
Α͘Θ͔ͬͯͳ͍෦
WJNͷϋΠϥΠτ ΩʔϫʔυͷϋΠϥΠτ͕ෆશ ????
+4$BNM Ҿ༻ݩIUUQTHJUIVCDPNGBDFCPPLFYQFSJNFOUBM+4$BNM
FTZ ZBSOͷGPSL μϯϩʔυͱϏϧυ͕۠ผ͞Ε͍ͯΔ
PQBNϒϦοδ
ࢀߟจݙ BXFTPNFSFBTPO IUUQTHJUIVCDPNWSBNBOBBXFTPNFSFBTPONMCMPCNBTUFS3&"%.&NE %BXOPG3FBTPO IUUQTTBOEFSTQJFTHJUIVCJPTMJEFTEBXOPGSFBTPOQEG 3FBTPOHVJEF IUUQTSFBTPONMHJUIVCJPHVJEF
#VDLMF4DSJQUNBOVBM IUUQCVDLMFTDSJQUHJUIVCJPCVDLMFTDSJQU.BOVBMIUNM
·ͱΊ +BWB4DSJQUʹ.-ͷػೳ͕ඞཁ ಋೖେมͩ͠ɺ0$BNMͬͨ΄͏͕ ͍͍ ͦͷ··ͭΒ͍ͷͰ͍ͨ͘͢͠ͷ ͕3FBTPO
None