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
RecordDotSyntaxのあれこれ
Search
Sponsored
·
SiteGround - Reliable hosting with speed, security, and support you can count on.
→
lotz
December 11, 2019
Programming
1.2k
2
Share
RecordDotSyntaxのあれこれ
lotz
December 11, 2019
More Decks by lotz
See All by lotz
Recursion Schemesで考える並べ替えアルゴリズム
lotz84
6
2.1k
関数と型で理解する自動微分
lotz84
6
3.1k
Other Decks in Programming
See All in Programming
AI時代になぜ書くのか
mutsumix
0
440
Agentic UI beyond Chats Architecture Patterns & Open Standards @ngMunich 05/2026
manfredsteyer
PRO
0
120
ソースコード→AST→オペコード、の旅を覗いてみる
o0h
PRO
1
140
Transactional Change Stream Processing With Debezium and Apache Flink
gunnarmorling
1
110
横断組織出身のQAEがインプロセスQAEでつまずいたこと・活かせたこと
ty89
0
160
The Past, Present, and Future of Enterprise Java
ivargrimstad
0
460
PHPでローカル環境用のSSL/TLS証明書を発行することはできるのか? #phpconkagawa
akase244
0
380
Structured Concurrency, Scoped Values and Joiners in the JDK 25 26 27
josepaumard
1
160
Sans tests, vos agents ne sont pas fiables
nabondance
0
140
20年以上続くプロダクトでも使い続けられる静的解析ツールを求めて
matsuo_atsushi
0
160
Oxlintはいかにしてtsgolintのlint ruleを呼び出しているのか
syumai
1
360
[BalkanRuby 2026] Drop your app/services!
palkan
3
620
Featured
See All Featured
My Coaching Mixtape
mlcsv
0
130
How Software Deployment tools have changed in the past 20 years
geshan
0
33k
Odyssey Design
rkendrick25
PRO
2
620
Connecting the Dots Between Site Speed, User Experience & Your Business [WebExpo 2025]
tammyeverts
11
910
SEO Brein meetup: CTRL+C is not how to scale international SEO
lindahogenes
1
2.6k
The Art of Delivering Value - GDevCon NA Keynote
reverentgeek
16
2k
Thoughts on Productivity
jonyablonski
76
5.2k
Chrome DevTools: State of the Union 2024 - Debugging React & Beyond
addyosmani
10
1.2k
Building the Perfect Custom Keyboard
takai
2
770
Designing Experiences People Love
moore
143
24k
Marketing to machines
jonoalderson
1
5.3k
Discover your Explorer Soul
emna__ayadi
2
1.1k
Transcript
Record Dot Syntax ͷ͋Ε͜Ε By lotz 2019/12/11 ୈ2ճGHCษڧձ @ IIJ-II
RecordDotSyntax https://github.com/shayne-fletcher-da/ghc-proposals/blob/record-dot-syntax/proposals/0000-record-dot-syntax.md#motivation
RecordDotSyntaxͷجຊ https://github.com/shayne-fletcher-da/ghc-proposals/blob/record-dot-syntax/proposals/0000-record-dot-syntax.md#recorddotsyntax-language-extension
RecordDotSyntaxͷੜߏจ https://github.com/shayne-fletcher-da/ghc-proposals/blob/record-dot-syntax/proposals/0000-record-dot-syntax.md#recorddotsyntax-language-extension
Recordվળͷ্ʹ͋Δ ()$֦ு1SPQPTBM ()$7FSTJPO %VQMJDBUF3FDPSE'JFMET 0WFSMPBEFE-BCFMT 0WFSMPBEFE3FDPSE'JFMET "EETFU'JFMEUP)BT'JFME
/P'JFME4FMFDUPST "DDFQUFE 3FDPSE%PU4ZOUBY /&8
DAMLͰͷ࣮͋Γ • DAMLHaskell/ScalaͰ։ൃ͞Ε͍ͯΔɺ εϚʔτίϯτϥΫτهड़ݴޠ • DAMLͷ։ൃʹ͓͍ͯGHC Pluginsͱ͍͏ܗͰ RecordDotSyntaxͱ΄΅ಉ͡ػೳ͕ΘΕ͍ͯΔ
ఏҊͯ͠ΔͷDAMLͷਓ https://github.com/ghc-proposals/ghc-proposals/pull/282
PRͷԠ https://github.com/ghc-proposals/ghc-proposals/pull/282#issuecomment-540968106 *TUSPOHMZTVQQPSUUIFEJSFDUJPOPG USBWFMPGUIJTQSPQPTBM
PRͷԠ 5IFMPTTPGQPMZNPSQIJDVQEBUFJT BIVHFQSPCMFN JNP https://github.com/ghc-proposals/ghc-proposals/pull/282#issuecomment-541111003
PRͷԠ 5IJTQSPQPTBMJTGVMMPGVUUFSOPOTFOTF https://github.com/ghc-proposals/ghc-proposals/pull/282#issuecomment-541460439
> :t (.age) (.age) :: Person -> Int > :t
(. age) (. age) :: (Int -> c) -> Person -> c ۭനͷ༗Γແ͠Ͱ͜͜·Ͱҙຯ͕มΘΔͷ ॳ৺ऀʹ͘͠ͳ͍ʁ
ࠓͷεςʔλε https://github.com/ghc-proposals/ghc-proposals/pull/282#issuecomment-559259994 8JUIUIFUIDPNNFOU BGUFSSFBDUJPOTPOUIFJOJUJBM QPTU QBSUJDJQBOUTBOEBUMFBTUQPMMTPGVTFSTFOUJNFOU *EMJLFUPUVSOUIJTPWFSUPUIFDPNNJUUFF
ະղܾ https://twitter.com/ndm_haskell/status/1190680324495302658
͋Ε͜Ε
f a.b.c x ͷύʔε f a.foo.bar.baz.quux 12 f (a.foo.bar.baz.quux)
12 ͱධՁ͞ΕΔ ((f a).foo.bar.baz.quux) 12Ͱͳ͍ https://github.com/shayne-fletcher-da/ghc-proposals/blob/record-dot-syntax/proposals/0000-record-dot-syntax.md#record-selection
Lensʁ • f $ record ^. field ͕ f record.field
ͱॻ͚Δ • Lensෳࡶա͗Δ… • Lensͱ໊લۭ͕ؒҟͳΔͷͰҰॹʹ͑Δ https://github.com/shayne-fletcher-da/ghc-proposals/blob/record-dot-syntax/proposals/0000-record-dot-syntax.md#alternatives-to-this-proposal
͜͏͍͏දهແ͍ • ߋ৽ʹؔ͢Δߏจ • a{field * 2} • a{field <-
(*2)} • a{field * = 2} • ߋ৽ʹؔ͢ΔηΫγϣϯ • ({a=}) • ({a=b}) • (.lbl=) https://github.com/shayne-fletcher-da/ghc-proposals/blob/record-dot-syntax/proposals/0000-record-dot-syntax.md#alternatives-within-this-proposal
Ҏ্