SlideShare a Scribd company logo
Eric Torreborre
Practical
Eff monad
Doing it for real
Pratical eff-scalaitaly-2017
Pratical eff-scalaitaly-2017
About Zalando
Brand solutions
Article service
Articleservice
Zeos
products
business-partners
stocks
59.95 €
10 items
How to deal?
Components!
Pratical eff-scalaitaly-2017
DI?
Cake?
Guice?
Spring?
Radical
Constructor
injection!
Pratical eff-scalaitaly-2017
Pratical eff-scalaitaly-2017
Pratical eff-scalaitaly-2017
Grafter
Pratical eff-scalaitaly-2017
Pratical eff-scalaitaly-2017
Pratical eff-scalaitaly-2017
Pratical eff-scalaitaly-2017
HttpServer
Routes
Services
Clients
Pratical eff-scalaitaly-2017
PriceHttpService
PriceHttp4sService
Pratical eff-scalaitaly-2017
Always one default
In a
library?
Pratical eff-scalaitaly-2017
reader
all the
way down!
Unit testing?
Integration testing?
HttpServer
Routes
Services
Clients
HttpServer
Routes
Services
Clients
Tree rewriting!
Kiama
Pratical eff-scalaitaly-2017
Pratical eff-scalaitaly-2017
Singleton?
HttpServer
Routes
Services
Clients
HttpServer
Routes
Services
Clients
Pratical eff-scalaitaly-2017
Pratical eff-scalaitaly-2017
Pratical eff-scalaitaly-2017
Pratical eff-scalaitaly-2017
Stay lazy!
Pratical eff-scalaitaly-2017
Start order?
Pratical eff-scalaitaly-2017
Pratical eff-scalaitaly-2017
lazy
reader
rewrite
start
Eff please!
Pratical eff-scalaitaly-2017
Pratical eff-scalaitaly-2017
What the Eff?
Pratical eff-scalaitaly-2017
Pratical eff-scalaitaly-2017
Pratical eff-scalaitaly-2017
Out of the box
Pratical eff-scalaitaly-2017
Pratical eff-scalaitaly-2017
Pratical eff-scalaitaly-2017
Article service
FlowId
HttpServer
Routes
Services
Clients
flowId
flowId
flowId
flowId
Pratical eff-scalaitaly-2017
Logged
Pratical eff-scalaitaly-2017
Pratical eff-scalaitaly-2017
Pratical eff-scalaitaly-2017
Pratical eff-scalaitaly-2017
Applicative
Concurrent
execution
MasterData PriceService
Inventory
Pratical eff-scalaitaly-2017
Pratical eff-scalaitaly-2017
Async
Pratical eff-scalaitaly-2017
TimedFutureEffect
TaskEffect
TaskEffect TaskEffect
TwitterFutureEffect
FlowId
Logged
Task
Eval
No
Reader[Config, ?]
Mitsaeks we made
Stack definition
Pratical eff-scalaitaly-2017
At the latest moment!
Errors
3 possibilities
1 error style per layer
Translation between layers
Use one error type
Use local effects!
Pratical eff-scalaitaly-2017
Pratical eff-scalaitaly-2017
Pratical eff-scalaitaly-2017
Everything is
a (Free) DSL?
Pratical eff-scalaitaly-2017
Make price request
request
[PriceRequest]
[PriceRequest]
response
Interpret request
[PriceRequest, Async]
[Async]
Pratical eff-scalaitaly-2017
Get price
price
[Async]
[Async]
Pratical eff-scalaitaly-2017
Time: effect or
component?
Get status
status
[Eval]
now?
[Eval]
now
Get status
status
[Eval]
now?
[Eval]
now FreezedTime
Get status
status
[Eval, Timed]
runFreezedTime(status)
[Eval]
Recap
Pratical eff-scalaitaly-2017
Pratical eff-scalaitaly-2017
Pratical eff-scalaitaly-2017
More
Applicative
Goodies!
Batching
Translation
client
Inventory
Translation
client
Inventory
Pratical eff-scalaitaly-2017
Pratical eff-scalaitaly-2017
Pratical eff-scalaitaly-2017
Pratical eff-scalaitaly-2017

More Related Content

PDF
Pratical eff monad at Scaladays Chicago
PDF
Pratical eff
PDF
Hacking Real time Messaging with Firebase
PPTX
Colin Bowern - The Not So Scary Side Of Asp.Net – Model View Controller In Th...
PDF
AWS MeetUp - Serverless Brewing IPAs
PDF
Domain Driven Rails
PDF
Exactly once delivery is a harsh mistress - DevOps Days TLV
PDF
From ActiveRecord to EventSourcing
Pratical eff monad at Scaladays Chicago
Pratical eff
Hacking Real time Messaging with Firebase
Colin Bowern - The Not So Scary Side Of Asp.Net – Model View Controller In Th...
AWS MeetUp - Serverless Brewing IPAs
Domain Driven Rails
Exactly once delivery is a harsh mistress - DevOps Days TLV
From ActiveRecord to EventSourcing

What's hot (19)

PDF
Beyond The Rails Way
PDF
Compute @ edge
PDF
Wire once, rewire twice! (Haskell exchange-2018)
PDF
The CQRS diet
PPTX
THE SCIENCE AND ART OF BACKWARDS COMPATIBILITY
PDF
Ruby loves DDD
PDF
Five Ways to Scale your API Without Touching Your Code
PPTX
Serverless in-action
PDF
Converting LotusScript Agents to Java Agents
PDF
Extending the New Relic Platform
PDF
Ruby on rails integration testing with minitest and capybara
PPTX
Securing Kafka with SPIFFE @ TransferWise
PDF
5 Anti-Patterns in API Design - DDD East Anglia 2015
PDF
Marrying angular rails
PDF
[DevDay 2017] Serverless Architecture - Speaker: Trung Huynh - Software Engin...
PDF
[DevDay 2017] ReactJS Hands on - Speaker: Binh Phan - Developer at mgm techno...
PDF
Writing SPA in 2017
PDF
No Graph Theory Required: Ember and GraphQL in Practice
DOC
Synch calling asynchadd
Beyond The Rails Way
Compute @ edge
Wire once, rewire twice! (Haskell exchange-2018)
The CQRS diet
THE SCIENCE AND ART OF BACKWARDS COMPATIBILITY
Ruby loves DDD
Five Ways to Scale your API Without Touching Your Code
Serverless in-action
Converting LotusScript Agents to Java Agents
Extending the New Relic Platform
Ruby on rails integration testing with minitest and capybara
Securing Kafka with SPIFFE @ TransferWise
5 Anti-Patterns in API Design - DDD East Anglia 2015
Marrying angular rails
[DevDay 2017] Serverless Architecture - Speaker: Trung Huynh - Software Engin...
[DevDay 2017] ReactJS Hands on - Speaker: Binh Phan - Developer at mgm techno...
Writing SPA in 2017
No Graph Theory Required: Ember and GraphQL in Practice
Synch calling asynchadd
Ad

Similar to Pratical eff-scalaitaly-2017 (20)

PDF
Pratical eff-functional-conf
PPTX
Twig internals - Maksym MoskvychevTwig internals maksym moskvychev
PDF
Systems Monitoring with Prometheus (Devops Ireland April 2015)
PDF
Scaling Machine Learning Systems up to Billions of Predictions per Day
PDF
Highly concurrent yet natural programming
PPTX
10 Principals for Effective Event-Driven Microservices with Apache Kafka
PDF
Monitoring your Python with Prometheus (Python Ireland April 2015)
PPTX
Cfalfresco
PPTX
Microservices for building an IDE – The innards of JetBrains Rider - TechDays...
PPTX
Microservices in the Apache Kafka Ecosystem
PPSX
Magento performancenbs
PPTX
Magento's Imagine eCommerce Conference: Do You Queue?
PPTX
10 Principals for Effective Event Driven Microservices
PDF
Shift-left SRE: Self-healing on OpenShift with Ansible
PPTX
ISI work
PPT
Building scalable and language-independent Java services using Apache Thrift ...
PPT
PDF
Documenting Your API
PPTX
Smart Enterprise Application Integration with Apache Camel
PDF
How to Build Complex Calls to APIs (Without Writing Any Code)
Pratical eff-functional-conf
Twig internals - Maksym MoskvychevTwig internals maksym moskvychev
Systems Monitoring with Prometheus (Devops Ireland April 2015)
Scaling Machine Learning Systems up to Billions of Predictions per Day
Highly concurrent yet natural programming
10 Principals for Effective Event-Driven Microservices with Apache Kafka
Monitoring your Python with Prometheus (Python Ireland April 2015)
Cfalfresco
Microservices for building an IDE – The innards of JetBrains Rider - TechDays...
Microservices in the Apache Kafka Ecosystem
Magento performancenbs
Magento's Imagine eCommerce Conference: Do You Queue?
10 Principals for Effective Event Driven Microservices
Shift-left SRE: Self-healing on OpenShift with Ansible
ISI work
Building scalable and language-independent Java services using Apache Thrift ...
Documenting Your API
Smart Enterprise Application Integration with Apache Camel
How to Build Complex Calls to APIs (Without Writing Any Code)
Ad

More from Eric Torreborre (20)

PDF
Shoehorning dependency injection into a FP language
PDF
Shoehorning dependency injection into a FP language, what does it take?
PDF
Boost your command line applications with potions!
PDF
wire-all-the-things-lambda-days-2023.pdf
PDF
The many faces of modularity
PDF
What haskell taught us when we were not looking
PDF
Specs2, from starters to dessert and... a look in the kitchen
PDF
Streaming, effects and beautiful folds: a winning trilogy
PPT
The Eff monad, one monad to rule them all
PPT
Easy di-slideshare
PPT
Data generation, the hard parts
PPT
Origami, a monadic fold library for Scala
PPT
Datatypes for the real world
PPT
Specs2 3.4
PPTX
DSLs with fold algebras
PPT
Specs2 whirlwind tour at Scaladays 2014
PPT
Epic success \/ failure, refactoring to *real* FP
PPT
Vampire methods
PPT
Specs2 whirlwind-tour
PPT
Scala days2013 proxyfactorybeandelegate
Shoehorning dependency injection into a FP language
Shoehorning dependency injection into a FP language, what does it take?
Boost your command line applications with potions!
wire-all-the-things-lambda-days-2023.pdf
The many faces of modularity
What haskell taught us when we were not looking
Specs2, from starters to dessert and... a look in the kitchen
Streaming, effects and beautiful folds: a winning trilogy
The Eff monad, one monad to rule them all
Easy di-slideshare
Data generation, the hard parts
Origami, a monadic fold library for Scala
Datatypes for the real world
Specs2 3.4
DSLs with fold algebras
Specs2 whirlwind tour at Scaladays 2014
Epic success \/ failure, refactoring to *real* FP
Vampire methods
Specs2 whirlwind-tour
Scala days2013 proxyfactorybeandelegate

Recently uploaded (20)

PDF
Building Integrated photovoltaic BIPV_UPV.pdf
PDF
Mobile App Security Testing_ A Comprehensive Guide.pdf
PDF
Diabetes mellitus diagnosis method based random forest with bat algorithm
PDF
Per capita expenditure prediction using model stacking based on satellite ima...
PDF
Blue Purple Modern Animated Computer Science Presentation.pdf.pdf
PDF
A comparative analysis of optical character recognition models for extracting...
PPTX
KOM of Painting work and Equipment Insulation REV00 update 25-dec.pptx
PPTX
Machine Learning_overview_presentation.pptx
PDF
Electronic commerce courselecture one. Pdf
PDF
gpt5_lecture_notes_comprehensive_20250812015547.pdf
PDF
Optimiser vos workloads AI/ML sur Amazon EC2 et AWS Graviton
PDF
Accuracy of neural networks in brain wave diagnosis of schizophrenia
PDF
cuic standard and advanced reporting.pdf
PPTX
Group 1 Presentation -Planning and Decision Making .pptx
PDF
Encapsulation_ Review paper, used for researhc scholars
PDF
Encapsulation theory and applications.pdf
PDF
The Rise and Fall of 3GPP – Time for a Sabbatical?
PPTX
20250228 LYD VKU AI Blended-Learning.pptx
PDF
Getting Started with Data Integration: FME Form 101
PDF
MIND Revenue Release Quarter 2 2025 Press Release
Building Integrated photovoltaic BIPV_UPV.pdf
Mobile App Security Testing_ A Comprehensive Guide.pdf
Diabetes mellitus diagnosis method based random forest with bat algorithm
Per capita expenditure prediction using model stacking based on satellite ima...
Blue Purple Modern Animated Computer Science Presentation.pdf.pdf
A comparative analysis of optical character recognition models for extracting...
KOM of Painting work and Equipment Insulation REV00 update 25-dec.pptx
Machine Learning_overview_presentation.pptx
Electronic commerce courselecture one. Pdf
gpt5_lecture_notes_comprehensive_20250812015547.pdf
Optimiser vos workloads AI/ML sur Amazon EC2 et AWS Graviton
Accuracy of neural networks in brain wave diagnosis of schizophrenia
cuic standard and advanced reporting.pdf
Group 1 Presentation -Planning and Decision Making .pptx
Encapsulation_ Review paper, used for researhc scholars
Encapsulation theory and applications.pdf
The Rise and Fall of 3GPP – Time for a Sabbatical?
20250228 LYD VKU AI Blended-Learning.pptx
Getting Started with Data Integration: FME Form 101
MIND Revenue Release Quarter 2 2025 Press Release

Pratical eff-scalaitaly-2017

Editor's Notes

  • #3: You learn new concepts....
  • #4: Now where to start?
  • #5: How do we use Eff at Zalando?
  • #6: Brand solutions - shop in shop (with CMS / analytics) - onboarding new merchants - small store - big brand
  • #7: Article service - onboarding new merchants - find an article id from the EAN - set stock, set price -> ready to sell!
  • #8: - evolving front-end APIs - evolving back-end services - evolving libraries
  • #9: What’s the proven technique for dealing with these constraints?
  • #10: Interface + implementation
  • #11: Encapsulate technical alternatives, not processes
  • #12: Cake Pattern? Guice? Spring?
  • #13: Cake Pattern? Guice? Spring?
  • #14: Cake Pattern? Guice? Spring?
  • #15: Cake Pattern? Guice? Spring?
  • #16: Radical idea: constructor injection
  • #17: Radical idea: constructor injection
  • #18: Radical idea: constructor injection
  • #19: Radical idea: constructor injection
  • #20: Radical idea: constructor injection
  • #22: Radical idea: constructor injection
  • #23: Radical idea: constructor injection
  • #28: Interfaces
  • #31: Radical idea: constructor injection
  • #40: Radical idea: constructor injection
  • #41: Radical idea: constructor injection
  • #43: Radical idea: constructor injection
  • #44: Radical idea: constructor injection
  • #49: Laziness is essential, nothing should start!
  • #50: Laziness is essential, nothing should start!
  • #51: Lazyness is essential, nothing should start!
  • #53: Start services from the bottom-up and collect results
  • #55: What has Eff to do with all of this?
  • #56: Which effects we want to use? Future, Reader, Writer?
  • #58: What has Eff to do with all of this?
  • #60: Either as request
  • #61: Either as request, interpreted with runEither
  • #66: Article service - onboarding new merchants - find an article id from the EAN - set stock, set price -> ready to sell!
  • #68: Radical idea: constructor injection
  • #75: Concurrent execution Batching
  • #76: Concurrent execution Batching
  • #77: Concurrent execution Batching
  • #78: Concurrent execution Batching
  • #80: What’s the problem with Future again?
  • #81: What’s the problem with Future again?
  • #86: This means that we don’t have to expose all effects at the component level!
  • #87: How do we deal with errors?
  • #88: How do we deal with errors?
  • #89: How do we deal with errors? - low level - domain level
  • #90: How do we deal with errors?
  • #91: How do we deal with errors?
  • #92: This means that we don’t have to expose all effects at the component level!
  • #93: This means that we don’t have to expose all effects at the component level!
  • #98: In general components are not interpreters except to
  • #99: Make price request gives you back a *program*
  • #100: Make price request gives you back a *program*
  • #101: Make price request gives you back a *computation*
  • #108: Recap on a service signature
  • #109: Recap on a service signature
  • #110: That's all folks!
  • #111: How do we deal with errors? - low level - domain level
  • #112: Concurrent execution Batching
  • #113: Concurrent execution Batching
  • #114: Batching
  • #115: Concurrent execution Batching
  • #116: Concurrent execution Batching
  • #117: Concurrent execution Batching
  • #118: Concurrent execution Batching