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
Applicative_Monadic_Validation_-_ScaLatam.pdf
Search
Raúl Piaggio
May 02, 2019
Programming
27
1
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
Applicative_Monadic_Validation_-_ScaLatam.pdf
Raúl Piaggio
May 02, 2019
Other Decks in Programming
See All in Programming
IBM Bob でAI駆動開発『QC-Playbook』
ichirokano2
0
110
カツオ、ご期待ください
suneo3476
0
190
PumaからFalconに移行したRailsアプリケーションでの実践
falcon8823
0
170
パスワード再設定メールのURLについて知っておこう
uyuki234
0
160
當我們開始不讀 Code - AI Agent 時代,Code Review 與 Clean Code 還剩下什麼?
jame2408
1
210
re:Inventに行く前に知っておきたい現地参加のノウハウ
nokomoro3
0
430
Unity6 URPによる海底をテーマにしたVJシステムの解説 | Unity Shader 完全に理解した 勉強会
gam0022
0
370
Workers Cache を知る
syumai
0
360
機械に任せるテスト、人が見るテスト ⽣成AIで引き直した、運⽤保守フェーズの線引き
dske104
0
190
パズルゲームの作り方 / how to make puzzle games
kaityo256
PRO
2
290
ハーネス設計入門 〜 基礎知識の整理から実務へのステップアップ 〜
kinopeee
28
32k
npm との違いを手がかりにGo の依存管理を理解したい
optim
0
340
Featured
See All Featured
svc-hook: hooking system calls on ARM64 by binary rewriting
retrage
2
630
Why You Should Never Use an ORM
jnunemaker
PRO
61
10k
Mozcon NYC 2025: Stop Losing SEO Traffic
samtorres
1
580
GraphQLの誤解/rethinking-graphql
sonatard
75
12k
16th Malabo Montpellier Forum Presentation
akademiya2063
PRO
0
410
30 Presentation Tips
portentint
PRO
1
430
Max Prin - Stacking Signals: How International SEO Comes Together (And Falls Apart)
techseoconnect
PRO
0
490
Amusing Abliteration
ianozsvald
1
350
Being A Developer After 40
akosma
92
590k
Code Reviewing Like a Champion
maltzj
529
40k
Have SEOs Ruined the Internet? - User Awareness of SEO in 2025
akashhashmi
0
520
Testing 201, or: Great Expectations
jmmastey
46
8.3k
Transcript
Mi Primer Validador Funcional (Effect agnostic) Raúl Piaggio - ScaLatam
2019 - 02/05/19
La larga (y no empinada) curva de aprendizaje de Scala
Librería base: io.underscore.validation
Librería base: io.underscore.validation
Librería base: io.underscore.validation
Librería base: io.underscore.validation DSL
Librería base: io.underscore.validation DSL
Preguntas hasta acá?
Dilema
Aha! Id Type
Aha! Id Type
Objetivos 01 Seguir usando código existente sin modificaciones (o modificaciones
mínimas). 02 Poder combinar contextos fácilmente. 03 Inferir contexto resultante.
Inspiración • Abstraer contexto: ◦ Tagless Final ◦ Free Monads
◦ Doobie • Scala Meetup Montevideo ◦ Natural Transformations: F[_] ~> G[_]
Cómo generalizamos? • Functor? Monad? Applicative! • Múltiples evaluaciones independientes.
• Paralelismo! • Qué obtenemos del contexto? ◦ map ◦ pure ◦ traverse/compose
Primeros pasos • Todos los “generadores base” existentes ahora validan
en contexto Id[_]. Ejemplo: • Todos los “modificadores” existentes respetan el contexto. Ejemplo:
Y qué hacemos con “and” ???
Comportamiento deseado
Más o menos se entiende hasta acá?
Solución
Solución
Listo! Código Real
Combinar contextos
Combinar contextos
Gracias!
[email protected]
@RaulPiaggio
Y las Monads??
Nueva encarnación de librería base: checklist
checklist puede modificar el valor
Hacemos lo mismo...
Pero si el valor se modifica no podemos paralelizar! Hay
dependencia...
Generalizamos CanLift (aún más)