SlideShare a Scribd company logo
1 of 21
FP libraries for handling complex
data
Daniel Alarcón Amador – Passionate People
What is Functional Programming
 “FP is a programming paradigm—a style of building the structure and
elements of computer programs—that treats computation as the
evaluation of mathematical functions and avoids changing-state and
mutable data.” - Wikipedia
Why do we use it?
 Immutability
 Reusability
 Cleaner code
 Purity
 Bye bye side effects
 To be as cool as Dan Abramov (creator from Redux)
How does it work?
FP approach
Regular approach, with mutation
Libraries available
 lodash/fp
 Ramda
 Underscore
 functional.js
 Funcy
 https://github.com/stoeffel/awesome-fp-js
Exercise – Which ones are pokemon?
Claire, pareto, onyx, shiny, prelude, dplyr, mori, timm, baobab, daggy, jynx,
kudo, kyogre, vulpix.js, slowpoke, crocks, imlazy, joda, scikit, funcy, ramda,
metapodx, celebi, gardevoir, gengar.
Solution
Claire, pareto, onyx, shiny, prelude, dplyr, mori, timm, baobab, daggy, jynx,
kudo, kyogre, vulpix.js, slowpoke, crocks, imlazy, joda, scikit, funcy, ramda,
metapodx, celebi, gardevoir, gengar.
How does it looks like - Lodash
How does it looks like - Vanilla
How does it looks like - Ramda
Ramda
 Ramda emphasizes a purer functional style.
Immutability and side-effect free functions are
at the heart of its design philosophy.
 Ramda functions are automatically curried.
This allows you to easily build up new
functions from old ones simply by not
supplying the final parameters.
 The parameters to Ramda functions are
arranged to make it convenient for currying.
The data to be operated on is generally
supplied last.
Path
Sort
Pipeline
Evolve
Example 1 – Radio feed
We have a page that will recommend a list of radio stations depending of:
 How trendy the radio is
 Order Id supplied via the Back End
 The suitable age of the radio station based in the user
Example 2 – Make an Inbox
The Back End sends you all the emails for one user
 Separate them into categories: Primary, social and promotions
 Filter the spam based in a “Spam Words” list.
 The emails need to be ordered by date.
Example 3 - Spotify
The Back End sends you a list of songs and related albums
 Make a list with the artist based in the songs received
 Every artist needs to have their albums with their songs in it.
 Some songs are not available in all the countries. Filter by [‘NL’, ‘USA’], etc.
 The wildcard ‘*’ means that the song is available for all the countries.
Questions ?
Be functional

More Related Content

Similar to FP libraries for handling complex data

Cataloging with RDA: An Overview
Cataloging with RDA: An OverviewCataloging with RDA: An Overview
Cataloging with RDA: An Overview
Emily Nimsakont
 
RDF_API_Java_Stefan_Apostoaie
RDF_API_Java_Stefan_ApostoaieRDF_API_Java_Stefan_Apostoaie
RDF_API_Java_Stefan_Apostoaie
iosstef
 

Similar to FP libraries for handling complex data (20)

TDC2017 | POA Trilha BigData - Escalabilidade, Performance e Arquitetura do A...
TDC2017 | POA Trilha BigData - Escalabilidade, Performance e Arquitetura do A...TDC2017 | POA Trilha BigData - Escalabilidade, Performance e Arquitetura do A...
TDC2017 | POA Trilha BigData - Escalabilidade, Performance e Arquitetura do A...
 
R programming Language
R programming LanguageR programming Language
R programming Language
 
Streaming Day - an overview of Stream Reasoning
Streaming Day - an overview of Stream ReasoningStreaming Day - an overview of Stream Reasoning
Streaming Day - an overview of Stream Reasoning
 
Scaling PyData Up and Out
Scaling PyData Up and OutScaling PyData Up and Out
Scaling PyData Up and Out
 
Exceptions are the Norm: Dealing with Bad Actors in ETL
Exceptions are the Norm: Dealing with Bad Actors in ETLExceptions are the Norm: Dealing with Bad Actors in ETL
Exceptions are the Norm: Dealing with Bad Actors in ETL
 
AI&BigData Lab 2016. Игорь Костюк: Как приручить музыкальную рекомендательную...
AI&BigData Lab 2016. Игорь Костюк: Как приручить музыкальную рекомендательную...AI&BigData Lab 2016. Игорь Костюк: Как приручить музыкальную рекомендательную...
AI&BigData Lab 2016. Игорь Костюк: Как приручить музыкальную рекомендательную...
 
Querying data on the Web – client or server?
Querying data on the Web – client or server?Querying data on the Web – client or server?
Querying data on the Web – client or server?
 
R programming
R programmingR programming
R programming
 
A Java Implementer's Guide to Better Apache Spark Performance
A Java Implementer's Guide to Better Apache Spark PerformanceA Java Implementer's Guide to Better Apache Spark Performance
A Java Implementer's Guide to Better Apache Spark Performance
 
Evolution of Programming Languages
Evolution of Programming LanguagesEvolution of Programming Languages
Evolution of Programming Languages
 
Igor Kostiuk “Как приручить музыкальную рекомендательную систему”
Igor Kostiuk “Как приручить музыкальную рекомендательную систему”Igor Kostiuk “Как приручить музыкальную рекомендательную систему”
Igor Kostiuk “Как приручить музыкальную рекомендательную систему”
 
OSS EU: Deep Dive into Building Streaming Applications with Apache Pulsar
OSS EU:  Deep Dive into Building Streaming Applications with Apache PulsarOSS EU:  Deep Dive into Building Streaming Applications with Apache Pulsar
OSS EU: Deep Dive into Building Streaming Applications with Apache Pulsar
 
NCompass Live: Cataloging with RDA
NCompass Live: Cataloging with RDANCompass Live: Cataloging with RDA
NCompass Live: Cataloging with RDA
 
Cataloging with RDA: An Overview
Cataloging with RDA: An OverviewCataloging with RDA: An Overview
Cataloging with RDA: An Overview
 
Big Data Science in Scala V2
Big Data Science in Scala V2 Big Data Science in Scala V2
Big Data Science in Scala V2
 
Flickr Php
Flickr PhpFlickr Php
Flickr Php
 
Progressive f# tutorials nyc dmitry mozorov & jack pappas on code quotations ...
Progressive f# tutorials nyc dmitry mozorov & jack pappas on code quotations ...Progressive f# tutorials nyc dmitry mozorov & jack pappas on code quotations ...
Progressive f# tutorials nyc dmitry mozorov & jack pappas on code quotations ...
 
Analyze one year of radio station songs aired with Spark SQL, Spotify, and Da...
Analyze one year of radio station songs aired with Spark SQL, Spotify, and Da...Analyze one year of radio station songs aired with Spark SQL, Spotify, and Da...
Analyze one year of radio station songs aired with Spark SQL, Spotify, and Da...
 
The Cost of Quick and Dirty
The Cost of Quick and DirtyThe Cost of Quick and Dirty
The Cost of Quick and Dirty
 
RDF_API_Java_Stefan_Apostoaie
RDF_API_Java_Stefan_ApostoaieRDF_API_Java_Stefan_Apostoaie
RDF_API_Java_Stefan_Apostoaie
 

Recently uploaded

Recently uploaded (20)

What is an API Development- Definition, Types, Specifications, Documentation.pdf
What is an API Development- Definition, Types, Specifications, Documentation.pdfWhat is an API Development- Definition, Types, Specifications, Documentation.pdf
What is an API Development- Definition, Types, Specifications, Documentation.pdf
 
Odoo vs Shopify: Why Odoo is Best for Ecommerce Website Builder in 2024
Odoo vs Shopify: Why Odoo is Best for Ecommerce Website Builder in 2024Odoo vs Shopify: Why Odoo is Best for Ecommerce Website Builder in 2024
Odoo vs Shopify: Why Odoo is Best for Ecommerce Website Builder in 2024
 
The mythical technical debt. (Brooke, please, forgive me)
The mythical technical debt. (Brooke, please, forgive me)The mythical technical debt. (Brooke, please, forgive me)
The mythical technical debt. (Brooke, please, forgive me)
 
Microsoft 365 Copilot; An AI tool changing the world of work _PDF.pdf
Microsoft 365 Copilot; An AI tool changing the world of work _PDF.pdfMicrosoft 365 Copilot; An AI tool changing the world of work _PDF.pdf
Microsoft 365 Copilot; An AI tool changing the world of work _PDF.pdf
 
Food Delivery Business App Development Guide 2024
Food Delivery Business App Development Guide 2024Food Delivery Business App Development Guide 2024
Food Delivery Business App Development Guide 2024
 
A Deep Dive into Secure Product Development Frameworks.pdf
A Deep Dive into Secure Product Development Frameworks.pdfA Deep Dive into Secure Product Development Frameworks.pdf
A Deep Dive into Secure Product Development Frameworks.pdf
 
Tree in the Forest - Managing Details in BDD Scenarios (live2test 2024)
Tree in the Forest - Managing Details in BDD Scenarios (live2test 2024)Tree in the Forest - Managing Details in BDD Scenarios (live2test 2024)
Tree in the Forest - Managing Details in BDD Scenarios (live2test 2024)
 
architecting-ai-in-the-enterprise-apis-and-applications.pdf
architecting-ai-in-the-enterprise-apis-and-applications.pdfarchitecting-ai-in-the-enterprise-apis-and-applications.pdf
architecting-ai-in-the-enterprise-apis-and-applications.pdf
 
Optimizing Operations by Aligning Resources with Strategic Objectives Using O...
Optimizing Operations by Aligning Resources with Strategic Objectives Using O...Optimizing Operations by Aligning Resources with Strategic Objectives Using O...
Optimizing Operations by Aligning Resources with Strategic Objectives Using O...
 
Entropy, Software Quality, and Innovation (presented at Princeton Plasma Phys...
Entropy, Software Quality, and Innovation (presented at Princeton Plasma Phys...Entropy, Software Quality, and Innovation (presented at Princeton Plasma Phys...
Entropy, Software Quality, and Innovation (presented at Princeton Plasma Phys...
 
AI Hackathon.pptx
AI                        Hackathon.pptxAI                        Hackathon.pptx
AI Hackathon.pptx
 
Crafting the Perfect Measurement Sheet with PLM Integration
Crafting the Perfect Measurement Sheet with PLM IntegrationCrafting the Perfect Measurement Sheet with PLM Integration
Crafting the Perfect Measurement Sheet with PLM Integration
 
Anypoint Code Builder - Munich MuleSoft Meetup - 16th May 2024
Anypoint Code Builder - Munich MuleSoft Meetup - 16th May 2024Anypoint Code Builder - Munich MuleSoft Meetup - 16th May 2024
Anypoint Code Builder - Munich MuleSoft Meetup - 16th May 2024
 
OpenChain @ LF Japan Executive Briefing - May 2024
OpenChain @ LF Japan Executive Briefing - May 2024OpenChain @ LF Japan Executive Briefing - May 2024
OpenChain @ LF Japan Executive Briefing - May 2024
 
Modern binary build systems - PyCon 2024
Modern binary build systems - PyCon 2024Modern binary build systems - PyCon 2024
Modern binary build systems - PyCon 2024
 
Implementing KPIs and Right Metrics for Agile Delivery Teams.pdf
Implementing KPIs and Right Metrics for Agile Delivery Teams.pdfImplementing KPIs and Right Metrics for Agile Delivery Teams.pdf
Implementing KPIs and Right Metrics for Agile Delivery Teams.pdf
 
Microsoft365_Dev_Security_2024_05_16.pdf
Microsoft365_Dev_Security_2024_05_16.pdfMicrosoft365_Dev_Security_2024_05_16.pdf
Microsoft365_Dev_Security_2024_05_16.pdf
 
IT Software Development Resume, Vaibhav jha 2024
IT Software Development Resume, Vaibhav jha 2024IT Software Development Resume, Vaibhav jha 2024
IT Software Development Resume, Vaibhav jha 2024
 
Workforce Efficiency with Employee Time Tracking Software.pdf
Workforce Efficiency with Employee Time Tracking Software.pdfWorkforce Efficiency with Employee Time Tracking Software.pdf
Workforce Efficiency with Employee Time Tracking Software.pdf
 
GraphSummit Stockholm - Neo4j - Knowledge Graphs and Product Updates
GraphSummit Stockholm - Neo4j - Knowledge Graphs and Product UpdatesGraphSummit Stockholm - Neo4j - Knowledge Graphs and Product Updates
GraphSummit Stockholm - Neo4j - Knowledge Graphs and Product Updates
 

FP libraries for handling complex data

  • 1. FP libraries for handling complex data Daniel Alarcón Amador – Passionate People
  • 2. What is Functional Programming  “FP is a programming paradigm—a style of building the structure and elements of computer programs—that treats computation as the evaluation of mathematical functions and avoids changing-state and mutable data.” - Wikipedia
  • 3. Why do we use it?  Immutability  Reusability  Cleaner code  Purity  Bye bye side effects  To be as cool as Dan Abramov (creator from Redux)
  • 4. How does it work? FP approach Regular approach, with mutation
  • 5. Libraries available  lodash/fp  Ramda  Underscore  functional.js  Funcy  https://github.com/stoeffel/awesome-fp-js
  • 6. Exercise – Which ones are pokemon? Claire, pareto, onyx, shiny, prelude, dplyr, mori, timm, baobab, daggy, jynx, kudo, kyogre, vulpix.js, slowpoke, crocks, imlazy, joda, scikit, funcy, ramda, metapodx, celebi, gardevoir, gengar.
  • 7. Solution Claire, pareto, onyx, shiny, prelude, dplyr, mori, timm, baobab, daggy, jynx, kudo, kyogre, vulpix.js, slowpoke, crocks, imlazy, joda, scikit, funcy, ramda, metapodx, celebi, gardevoir, gengar.
  • 8. How does it looks like - Lodash
  • 9. How does it looks like - Vanilla
  • 10. How does it looks like - Ramda
  • 11. Ramda  Ramda emphasizes a purer functional style. Immutability and side-effect free functions are at the heart of its design philosophy.  Ramda functions are automatically curried. This allows you to easily build up new functions from old ones simply by not supplying the final parameters.  The parameters to Ramda functions are arranged to make it convenient for currying. The data to be operated on is generally supplied last.
  • 12.
  • 13. Path
  • 14. Sort
  • 17. Example 1 – Radio feed We have a page that will recommend a list of radio stations depending of:  How trendy the radio is  Order Id supplied via the Back End  The suitable age of the radio station based in the user
  • 18. Example 2 – Make an Inbox The Back End sends you all the emails for one user  Separate them into categories: Primary, social and promotions  Filter the spam based in a “Spam Words” list.  The emails need to be ordered by date.
  • 19. Example 3 - Spotify The Back End sends you a list of songs and related albums  Make a list with the artist based in the songs received  Every artist needs to have their albums with their songs in it.  Some songs are not available in all the countries. Filter by [‘NL’, ‘USA’], etc.  The wildcard ‘*’ means that the song is available for all the countries.

Editor's Notes

  1. Functional programming (often abbreviated FP) is the process of building software by composing pure functions, avoiding shared state, mutable data, and side-effects. Functional programming is declarative rather than imperative, and application state flows through pure functions. Contrast with object oriented programming, where application state is usually shared and colocated with methods in objects.