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
クリぼっちの自分が信じられるのはもはや型のみである
Search
Ryota Sakaguchi
December 25, 2018
Technology
480
1
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
クリぼっちの自分が 信じられるのは もはや型のみである
Ryota Sakaguchi
December 25, 2018
More Decks by Ryota Sakaguchi
See All by Ryota Sakaguchi
大切なことは全てLintが教えてくれた
kuluna
0
54
時間を意識する推しツールたち / Time-aware tools
kuluna
1
640
DroidKaigi2020 - Data Bindingのイロハ
kuluna
1
1.5k
チームでつくる RESTful API
kuluna
1
12k
Other Decks in Technology
See All in Technology
サプライチェーンセキュリティの空白地帯 - 信頼できる”依存性”の未来を考える
rung
PRO
2
740
AI活用を推進するために ファインディが下した、一つの小さな決断
starfish719
0
250
Dynamic Workersについて
yusukebe
2
610
TypeScript Compiler APIとPHP-Parserを活用し、TypeScriptとPHPで型を共有する
shuta13
0
360
React、まだ楽しくて草
uhyo
7
4.1k
Rubyで音を視る
ydah
1
100
Building applications in the Gemini API family.
line_developers_tw
PRO
0
1.9k
ABEMA の Datadog × OTel 基盤、 中から見るか? 外から見るか?
tetsuya28
0
110
「速く作る」から「正しく作る」へ ─ 生成AI時代の開発フロー改革の ロードマップと実行 ─
starfish719
0
8.2k
AI Engineering Summit Tokyo 2026 AIの前に、やることがある 〜医療データ企業の4フェーズ〜
dtaniwaki
0
2k
Databricks 月刊サービスアップデート 2026年05月号
tyosi1212
0
210
ChatworkとBPaaS 異なる特性で学んだAI機能開発の ベストプラクティス
kubell_hr
2
2.9k
Featured
See All Featured
Leveraging Curiosity to Care for An Aging Population
cassininazir
1
260
Winning Ecommerce Organic Search in an AI Era - #searchnstuff2025
aleyda
1
2k
Fantastic passwords and where to find them - at NoRuKo
philnash
52
3.7k
Conquering PDFs: document understanding beyond plain text
inesmontani
PRO
4
2.8k
More Than Pixels: Becoming A User Experience Designer
marktimemedia
3
430
Ten Tips & Tricks for a 🌱 transition
stuffmc
0
130
The SEO Collaboration Effect
kristinabergwall1
1
480
How STYLIGHT went responsive
nonsquared
100
6.2k
The Illustrated Children's Guide to Kubernetes
chrisshort
51
52k
Visualizing Your Data: Incorporating Mongo into Loggly Infrastructure
mongodb
49
10k
Balancing Empowerment & Direction
lara
6
1.1k
Save Time (by Creating Custom Rails Generators)
garrettdimon
PRO
32
3.3k
Transcript
{ "shop": { "id": 1, "name": "", "employees": [ {
"id": 1, "job_id": 1, "name": "kuluna" } ] } }
import Foundation struct Employee: Decodable { let id: Int let
job_id: Int let name: String } struct Shop: Decodable { let id: Int let name: String let employees: [Employee] } struct ShopResponse: Decodable { let shop: Shop }
let response = try! JSONDecoder().decode( ShopResponse.self, from: json.data(using: .utf8)! )
print(response.shop.name) // “”
☺
let shop = response.shop shop.id == shop.employees.first?.job_id
let newEmployee = Employee( id: shop.id, job_id: 0, name: "Sakaguchi"
)
!
-
!
struct ShopId: Codable, Equatable { let value: Int init(_ value:
Int) { self.value = value } public init(from decoder: Decoder) throws { self.value = try decoder.singleValueContainer().decode(Int.self) } public func encode(to encoder: Encoder) throws { var c = encoder.singleValueContainer() try c.encode(self.value) } }
struct Shop: Decodable { let id: ShopId let name: String
let employees: [Employee] }
☺ ☺ Comparable