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
Vavrコレクションの紹介 〜 Javaでより安全で楽な関数型プログラミング〜
Search
Shota Sada
June 08, 2025
63
0
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
Vavrコレクションの紹介 〜 Javaでより安全で楽な関数型プログラミング〜
JJUG CCC 2025春の交流会LTで発表した資料です
Shota Sada
June 08, 2025
Featured
See All Featured
The Limits of Empathy - UXLibs8
cassininazir
2
720
DBのスキルで生き残る技術 - AI時代におけるテーブル設計の勘所
soudai
PRO
68
58k
Hiding What from Whom? A Critical Review of the History of Programming languages for Music
tomoyanonymous
3
1.4k
Design of three-dimensional binary manipulators for pick-and-place task avoiding obstacles (IECON2024)
konakalab
0
630
So, you think you're a good person
axbom
PRO
2
2.2k
The Myth of the Modular Monolith - Day 2 Keynote - Rails World 2024
eileencodes
28
3.7k
Practical Tips for Bootstrapping Information Extraction Pipelines
honnibal
25
2.1k
SERP Conf. Vienna - Web Accessibility: Optimizing for Inclusivity and SEO
sarafernandez
2
1.6k
Dominate Local Search Results - an insider guide to GBP, reviews, and Local SEO
greggifford
PRO
0
370
Visualizing Your Data: Incorporating Mongo into Loggly Infrastructure
mongodb
50
10k
How to Build an AI Search Optimization Roadmap - Criteria and Steps to Take #SEOIRL
aleyda
1
2.2k
Statistics for Hackers
jakevdp
799
230k
Transcript
Vavrコレクションの紹介 〜 Javaでより安全で楽な関数型プログラミング〜 JJUG CCC 2025 Spring 交流会LT さだ(@sada_ft)
自己紹介 • さだ(@sada_ft) • ユーザー系IT企業勤務(新卒2年目) • フロント(TS/React) • バック(Java/Spring Boot)
• 初LTです!
こんなことありませんか? • うっかりMutableな引数を渡してしまった 処理中に別スレッドから data.add(“邪魔者”);
こんなことありませんか? • stream噛ませて、最後に終端操作、、、 素晴らしい機能だが、ちょっとめんどくさい • できれば戻り値もイミュータブルにしたい
そこで今回紹介するライブラリが、、、
Vavr • デフォルトで イミュータブル • 関数型プログラミングをサポート • 発音はヴァヴル・ヴェイヴァーかと思ったが、 ヴェイヴっぽい(/ˈveɪ.vɚ/)
None
コードで見る不変性 常に新しい イミュータブルリスト が帰ってくる!
メモリ効率の工夫
シンプルな関数型プログラミング体験 Stream化・終端操作 が不要
パフォーマンス比較
まとめ • 安全なコードを書きたいなら Vavrは便利! • Javaの標準に比べるとパフォーマンスが落ちるが、 バグを未然に防げるのはうれしい (Map、Setもいい感じ) • デメリット
• 標準コレクションとごっちゃになりそう (チーム開発で使う場合は何かしらのご配慮を) 公式:https://vavr.io/