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.
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.