SlideShare una empresa de Scribd logo
1 de 15
Descargar para leer sin conexión
Presented By: Yash Gupta
Getting started with
FP IO
Lack of etiquette and manners is a huge turn off.
KnolX Etiquettes
Punctuality
Join the session 5 minutes prior to
the session start time. We start on
time and conclude on time!
Feedback
Make sure to submit a constructive
feedback for all sessions as it is
very helpful for the presenter.
Silent Mode
Keep your mobile devices in silent
mode, feel free to move out of
session in case you need to attend
an urgent call.
Avoid Disturbance
Avoid unwanted chit chat during
the session.
Our Agenda
01
03:35 PM Problem
02
03:45 PM Solution
03
03:55 PM Introduction to IO
04
04:00 PM Demo
Problem
Statement
Imagine you are developing an application that accesses the lists of flights from several flight providers. Now you need
to log the best flight that has the lowest price and least stoppages, the cheapest flight, and the fastest flight from the lists
of flights.
You’d like to write tests to ensure this happens as expected.
How would you implement this?
Conditions:
● There should be no Side-effects
● It should be Referential transparent
● It should be asynchronous and scalable
● It should handles the exceptions
Problem
Statement
Imagine you are developing an application that accesses the lists of flights from several flight providers. Now you need
to log the best flight that has the lowest price and least stoppages, the cheapest flight, and the fastest flight from the lists
of flights.
You’d like to write tests to ensure this happens as expected.
How would you implement this?
Conditions:
● There should be no Side-effects
● It should be Referential transparent
● It should be asynchronous and scalable
● It should handles the exceptions
The Future
Problem
Statement
Imagine you are developing an application that accesses the lists of flights from several flight providers. Now you need
to log the best flight that has the lowest price and least stoppages, the cheapest flight, and the fastest flight from the lists
of flights.
You’d like to write tests to ensure this happens as expected.
How would you implement this?
Conditions:
● There should be no Side-effects
● It should be Referential transparent
● It should be asynchronous and scalable
● It should handles the exceptions
The Future
Effects/side-effects
A function or expression that alters the status of something outside of its local context is known
as a side-effect.
Example: -> It can just be printing to the terminal, calling a database, or reading and writing files.
Referential Transparency
Purely functional languages have the feature that expressions are evaluated to the same result
every time and that the expression can be substituted by its result without altering the way the
programme behaves.
Let me give you the examples of both.
Why not Future?
Previous conditions:
● There should be no Side-effects
● It should be Referential transparent
● It should be asynchronous and scalable
● It should handles the exceptions
Why not Future?
Previous conditions:
● There should be no Side-effects
● It should be Referential transparent
● It should be asynchronous and scalable
● It should handles the exceptions
Letʼs see how
Why not Future?
Previous conditions:
● There should be no Side-effects
● It should be Referential transparent
● It should be asynchronous and scalable
● It should handles the exceptions
Because
Your program eagerly evaluates Future value
(i.e., it starts their execution as soon as it initialise them)
So, Why IO??
So, Why IO??
Because
● It has an alternative way to represent side effects lazily rather than eagerly
● You’ll create a description of your computation (full control on execution)
● Can run asynchronous
● Due to clear separation between description and execution it is referentially transparent
So, Why IO??
Because
● It has an alternative way to represent side effects lazily rather than eagerly
● You’ll create a description of your computation (full control on execution)
● Can run asynchronous
● Due to clear separation between description and execution it is referentially transparent
So,
An IO is a data structure that represents just a description of a side effectful computation.
Since IO values are unaltered and pure, they maintain the transparency of references and can be used in
functional programming.
Demo
Thank You !
Get in touch with us:
Scala Studio

Más contenido relacionado

Similar a Getting started with FP IO

Pair Programming Presentation
Pair Programming PresentationPair Programming Presentation
Pair Programming Presentation
ThoughtWorks
 

Similar a Getting started with FP IO (20)

Functional programmning
Functional programmningFunctional programmning
Functional programmning
 
Laptop Devops: Putting Modern Infrastructure Automation to Work For Local Dev...
Laptop Devops: Putting Modern Infrastructure Automation to Work For Local Dev...Laptop Devops: Putting Modern Infrastructure Automation to Work For Local Dev...
Laptop Devops: Putting Modern Infrastructure Automation to Work For Local Dev...
 
Effective Unit Testing
Effective Unit TestingEffective Unit Testing
Effective Unit Testing
 
Introduction to Functional Programming
Introduction to Functional ProgrammingIntroduction to Functional Programming
Introduction to Functional Programming
 
Test strategy
Test strategyTest strategy
Test strategy
 
How to Build a Proof of Concept
How to Build a Proof of Concept How to Build a Proof of Concept
How to Build a Proof of Concept
 
Systematic error management - we ported rudder to zio
Systematic error management - we ported rudder to zioSystematic error management - we ported rudder to zio
Systematic error management - we ported rudder to zio
 
Practical DevSecOps: Fundamentals of Successful Programs
Practical DevSecOps: Fundamentals of Successful ProgramsPractical DevSecOps: Fundamentals of Successful Programs
Practical DevSecOps: Fundamentals of Successful Programs
 
Basics of writing clean code
Basics of writing clean codeBasics of writing clean code
Basics of writing clean code
 
Software testing enhance quality and performance of software
Software testing enhance quality and performance of softwareSoftware testing enhance quality and performance of software
Software testing enhance quality and performance of software
 
Retrofitting a legacy SPA to use a functional architecture
Retrofitting a legacy SPA to use a functional architectureRetrofitting a legacy SPA to use a functional architecture
Retrofitting a legacy SPA to use a functional architecture
 
Stop Sucking at Building Stuff!
Stop Sucking at Building Stuff!Stop Sucking at Building Stuff!
Stop Sucking at Building Stuff!
 
Automated Testing in Angular Slides
Automated Testing in Angular SlidesAutomated Testing in Angular Slides
Automated Testing in Angular Slides
 
Are enterprises ready for the OpenStack transformation
Are enterprises ready for the OpenStack transformationAre enterprises ready for the OpenStack transformation
Are enterprises ready for the OpenStack transformation
 
Pair Programming Presentation
Pair Programming PresentationPair Programming Presentation
Pair Programming Presentation
 
Eclipse Day India 2015 - Eclipse RCP testing using Jubula based automation
Eclipse Day India 2015 - Eclipse RCP testing using Jubula based automationEclipse Day India 2015 - Eclipse RCP testing using Jubula based automation
Eclipse Day India 2015 - Eclipse RCP testing using Jubula based automation
 
The art of Bugging
The art of BuggingThe art of Bugging
The art of Bugging
 
The Final Frontier, Automating Dynamic Security Testing
The Final Frontier, Automating Dynamic Security TestingThe Final Frontier, Automating Dynamic Security Testing
The Final Frontier, Automating Dynamic Security Testing
 
Effects, Coeffects & Subscriptions: a pit of success for SPAs
Effects, Coeffects & Subscriptions: a pit of success for SPAsEffects, Coeffects & Subscriptions: a pit of success for SPAs
Effects, Coeffects & Subscriptions: a pit of success for SPAs
 
So You Just Inherited a $Legacy Application… NomadPHP July 2016
So You Just Inherited a $Legacy Application… NomadPHP July 2016So You Just Inherited a $Legacy Application… NomadPHP July 2016
So You Just Inherited a $Legacy Application… NomadPHP July 2016
 

Más de Knoldus Inc.

Más de Knoldus Inc. (20)

Supply chain security with Kubeclarity.pptx
Supply chain security with Kubeclarity.pptxSupply chain security with Kubeclarity.pptx
Supply chain security with Kubeclarity.pptx
 
Mastering Web Scraping with JSoup Unlocking the Secrets of HTML Parsing
Mastering Web Scraping with JSoup Unlocking the Secrets of HTML ParsingMastering Web Scraping with JSoup Unlocking the Secrets of HTML Parsing
Mastering Web Scraping with JSoup Unlocking the Secrets of HTML Parsing
 
Akka gRPC Essentials A Hands-On Introduction
Akka gRPC Essentials A Hands-On IntroductionAkka gRPC Essentials A Hands-On Introduction
Akka gRPC Essentials A Hands-On Introduction
 
Entity Core with Core Microservices.pptx
Entity Core with Core Microservices.pptxEntity Core with Core Microservices.pptx
Entity Core with Core Microservices.pptx
 
Introduction to Redis and its features.pptx
Introduction to Redis and its features.pptxIntroduction to Redis and its features.pptx
Introduction to Redis and its features.pptx
 
GraphQL with .NET Core Microservices.pdf
GraphQL with .NET Core Microservices.pdfGraphQL with .NET Core Microservices.pdf
GraphQL with .NET Core Microservices.pdf
 
NuGet Packages Presentation (DoT NeT).pptx
NuGet Packages Presentation (DoT NeT).pptxNuGet Packages Presentation (DoT NeT).pptx
NuGet Packages Presentation (DoT NeT).pptx
 
Data Quality in Test Automation Navigating the Path to Reliable Testing
Data Quality in Test Automation Navigating the Path to Reliable TestingData Quality in Test Automation Navigating the Path to Reliable Testing
Data Quality in Test Automation Navigating the Path to Reliable Testing
 
K8sGPTThe AI​ way to diagnose Kubernetes
K8sGPTThe AI​ way to diagnose KubernetesK8sGPTThe AI​ way to diagnose Kubernetes
K8sGPTThe AI​ way to diagnose Kubernetes
 
Introduction to Circle Ci Presentation.pptx
Introduction to Circle Ci Presentation.pptxIntroduction to Circle Ci Presentation.pptx
Introduction to Circle Ci Presentation.pptx
 
Robusta -Tool Presentation (DevOps).pptx
Robusta -Tool Presentation (DevOps).pptxRobusta -Tool Presentation (DevOps).pptx
Robusta -Tool Presentation (DevOps).pptx
 
Optimizing Kubernetes using GOLDILOCKS.pptx
Optimizing Kubernetes using GOLDILOCKS.pptxOptimizing Kubernetes using GOLDILOCKS.pptx
Optimizing Kubernetes using GOLDILOCKS.pptx
 
Azure Function App Exception Handling.pptx
Azure Function App Exception Handling.pptxAzure Function App Exception Handling.pptx
Azure Function App Exception Handling.pptx
 
CQRS Design Pattern Presentation (Java).pptx
CQRS Design Pattern Presentation (Java).pptxCQRS Design Pattern Presentation (Java).pptx
CQRS Design Pattern Presentation (Java).pptx
 
ETL Observability: Azure to Snowflake Presentation
ETL Observability: Azure to Snowflake PresentationETL Observability: Azure to Snowflake Presentation
ETL Observability: Azure to Snowflake Presentation
 
Scripting with K6 - Beyond the Basics Presentation
Scripting with K6 - Beyond the Basics PresentationScripting with K6 - Beyond the Basics Presentation
Scripting with K6 - Beyond the Basics Presentation
 
Getting started with dotnet core Web APIs
Getting started with dotnet core Web APIsGetting started with dotnet core Web APIs
Getting started with dotnet core Web APIs
 
Introduction To Rust part II Presentation
Introduction To Rust part II PresentationIntroduction To Rust part II Presentation
Introduction To Rust part II Presentation
 
Data governance with Unity Catalog Presentation
Data governance with Unity Catalog PresentationData governance with Unity Catalog Presentation
Data governance with Unity Catalog Presentation
 
Configuring Workflows & Validators in JIRA
Configuring Workflows & Validators in JIRAConfiguring Workflows & Validators in JIRA
Configuring Workflows & Validators in JIRA
 

Último

Architecting Cloud Native Applications
Architecting Cloud Native ApplicationsArchitecting Cloud Native Applications
Architecting Cloud Native Applications
WSO2
 

Último (20)

Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin WoodPolkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
 
Artificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyArtificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : Uncertainty
 
DBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor PresentationDBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor Presentation
 
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWEREMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
 
Ransomware_Q4_2023. The report. [EN].pdf
Ransomware_Q4_2023. The report. [EN].pdfRansomware_Q4_2023. The report. [EN].pdf
Ransomware_Q4_2023. The report. [EN].pdf
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024
 
Navi Mumbai Call Girls 🥰 8617370543 Service Offer VIP Hot Model
Navi Mumbai Call Girls 🥰 8617370543 Service Offer VIP Hot ModelNavi Mumbai Call Girls 🥰 8617370543 Service Offer VIP Hot Model
Navi Mumbai Call Girls 🥰 8617370543 Service Offer VIP Hot Model
 
MS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectorsMS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectors
 
Apidays Singapore 2024 - Modernizing Securities Finance by Madhu Subbu
Apidays Singapore 2024 - Modernizing Securities Finance by Madhu SubbuApidays Singapore 2024 - Modernizing Securities Finance by Madhu Subbu
Apidays Singapore 2024 - Modernizing Securities Finance by Madhu Subbu
 
Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)
 
FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Script
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
 
Architecting Cloud Native Applications
Architecting Cloud Native ApplicationsArchitecting Cloud Native Applications
Architecting Cloud Native Applications
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
 
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ..."I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
 
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, AdobeApidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
 
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
 
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingRepurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
 

Getting started with FP IO

  • 1. Presented By: Yash Gupta Getting started with FP IO
  • 2. Lack of etiquette and manners is a huge turn off. KnolX Etiquettes Punctuality Join the session 5 minutes prior to the session start time. We start on time and conclude on time! Feedback Make sure to submit a constructive feedback for all sessions as it is very helpful for the presenter. Silent Mode Keep your mobile devices in silent mode, feel free to move out of session in case you need to attend an urgent call. Avoid Disturbance Avoid unwanted chit chat during the session.
  • 3. Our Agenda 01 03:35 PM Problem 02 03:45 PM Solution 03 03:55 PM Introduction to IO 04 04:00 PM Demo
  • 4. Problem Statement Imagine you are developing an application that accesses the lists of flights from several flight providers. Now you need to log the best flight that has the lowest price and least stoppages, the cheapest flight, and the fastest flight from the lists of flights. You’d like to write tests to ensure this happens as expected. How would you implement this? Conditions: ● There should be no Side-effects ● It should be Referential transparent ● It should be asynchronous and scalable ● It should handles the exceptions
  • 5. Problem Statement Imagine you are developing an application that accesses the lists of flights from several flight providers. Now you need to log the best flight that has the lowest price and least stoppages, the cheapest flight, and the fastest flight from the lists of flights. You’d like to write tests to ensure this happens as expected. How would you implement this? Conditions: ● There should be no Side-effects ● It should be Referential transparent ● It should be asynchronous and scalable ● It should handles the exceptions The Future
  • 6. Problem Statement Imagine you are developing an application that accesses the lists of flights from several flight providers. Now you need to log the best flight that has the lowest price and least stoppages, the cheapest flight, and the fastest flight from the lists of flights. You’d like to write tests to ensure this happens as expected. How would you implement this? Conditions: ● There should be no Side-effects ● It should be Referential transparent ● It should be asynchronous and scalable ● It should handles the exceptions The Future
  • 7. Effects/side-effects A function or expression that alters the status of something outside of its local context is known as a side-effect. Example: -> It can just be printing to the terminal, calling a database, or reading and writing files. Referential Transparency Purely functional languages have the feature that expressions are evaluated to the same result every time and that the expression can be substituted by its result without altering the way the programme behaves. Let me give you the examples of both.
  • 8. Why not Future? Previous conditions: ● There should be no Side-effects ● It should be Referential transparent ● It should be asynchronous and scalable ● It should handles the exceptions
  • 9. Why not Future? Previous conditions: ● There should be no Side-effects ● It should be Referential transparent ● It should be asynchronous and scalable ● It should handles the exceptions Letʼs see how
  • 10. Why not Future? Previous conditions: ● There should be no Side-effects ● It should be Referential transparent ● It should be asynchronous and scalable ● It should handles the exceptions Because Your program eagerly evaluates Future value (i.e., it starts their execution as soon as it initialise them)
  • 12. So, Why IO?? Because ● It has an alternative way to represent side effects lazily rather than eagerly ● You’ll create a description of your computation (full control on execution) ● Can run asynchronous ● Due to clear separation between description and execution it is referentially transparent
  • 13. So, Why IO?? Because ● It has an alternative way to represent side effects lazily rather than eagerly ● You’ll create a description of your computation (full control on execution) ● Can run asynchronous ● Due to clear separation between description and execution it is referentially transparent So, An IO is a data structure that represents just a description of a side effectful computation. Since IO values are unaltered and pure, they maintain the transparency of references and can be used in functional programming.
  • 14. Demo
  • 15. Thank You ! Get in touch with us: Scala Studio