SlideShare a Scribd company logo
1 of 7
Download to read offline
8 MINUTES OF
MONAD
TRANSFORMERS
THINGS THAT YOU ARE AFRAID TO
ASK HASKELL DEVELOPERS
...you don't need to know what is it in case of this topic.
MONADS
8MINUTESOF MONADTRANSFORMERS
Future("1")
       .map(_ + "0")
       .map(_.toInt)
// result: 10
List("1", "2", "3", "4")
       .map(_.toInt)
       .map(_ * 2)
// result: [2, 4, 6, 8]
...you don't need to know what is it in case of this topic.
MONADS
8MINUTESOF MONADTRANSFORMERS
Future("1")
       .map(_ + "0")
       .map(_.toInt)
// result: 10
List("1", "2", "3", "4")
       .map(_.toInt)
       .map(_ * 2)
// result: 2, 4, 6, 8
...you don't need to know what is it in case of this
topic.
MONAD
8MINUTESOF MONADTRANSFORMERS
Future(List("1", "2", "3"))
       .map(???)
...way to use nested monads.
MONAD T
8MINUTESOF MONADTRANSFORMERS
Future(List("1", "2", "3"))
       .map(_.map(doSmth))
...way to use nested monads.
MONAD T
8MINUTESOF MONADTRANSFORMERS
implicit class FutureListMonadT[A](a: Future[List[A]]) {
    def mapT[B](f: A => B): Future[List[B]] = 
        a.map(_.map(f))
}
Future(List("1", "2", "3"))
      .mapT(doSmth)
THANKS!
TIME TO ARGUE

More Related Content

Viewers also liked

Innocence Network's 1st People's Tribunal - Jury Report
Innocence Network's 1st People's Tribunal - Jury ReportInnocence Network's 1st People's Tribunal - Jury Report
Innocence Network's 1st People's Tribunal - Jury ReportAashish Yadav
 
Adicción al internet
Adicción al internetAdicción al internet
Adicción al internetIsaac322
 
Trabajo de computación: Adicción a Internet
Trabajo de computación: Adicción a InternetTrabajo de computación: Adicción a Internet
Trabajo de computación: Adicción a InternetBigC985
 
Colegio.pptx 1
Colegio.pptx 1Colegio.pptx 1
Colegio.pptx 1BigC985
 
Manual de Convivencia 2016-2017 AGH
Manual de Convivencia 2016-2017 AGHManual de Convivencia 2016-2017 AGH
Manual de Convivencia 2016-2017 AGHJulian Cardenas
 
Aivot ja visuaalisuus - miksi designilla on väliä
Aivot ja visuaalisuus - miksi designilla on väliäAivot ja visuaalisuus - miksi designilla on väliä
Aivot ja visuaalisuus - miksi designilla on väliäEssi Raunamaa
 

Viewers also liked (13)

TPS
TPSTPS
TPS
 
Innocence Network's 1st People's Tribunal - Jury Report
Innocence Network's 1st People's Tribunal - Jury ReportInnocence Network's 1st People's Tribunal - Jury Report
Innocence Network's 1st People's Tribunal - Jury Report
 
Clase 6 gir
Clase 6 girClase 6 gir
Clase 6 gir
 
Gir clase 1
Gir clase 1Gir clase 1
Gir clase 1
 
Adicción al internet
Adicción al internetAdicción al internet
Adicción al internet
 
Trabajo de computación: Adicción a Internet
Trabajo de computación: Adicción a InternetTrabajo de computación: Adicción a Internet
Trabajo de computación: Adicción a Internet
 
Personal_2_2015
Personal_2_2015Personal_2_2015
Personal_2_2015
 
Gir clase 2
Gir clase 2Gir clase 2
Gir clase 2
 
Clase 3 gir
Clase 3 girClase 3 gir
Clase 3 gir
 
Colegio.pptx 1
Colegio.pptx 1Colegio.pptx 1
Colegio.pptx 1
 
Hossam Aboelsoud
Hossam AboelsoudHossam Aboelsoud
Hossam Aboelsoud
 
Manual de Convivencia 2016-2017 AGH
Manual de Convivencia 2016-2017 AGHManual de Convivencia 2016-2017 AGH
Manual de Convivencia 2016-2017 AGH
 
Aivot ja visuaalisuus - miksi designilla on väliä
Aivot ja visuaalisuus - miksi designilla on väliäAivot ja visuaalisuus - miksi designilla on väliä
Aivot ja visuaalisuus - miksi designilla on väliä
 

Similar to 8 minutes of monad transformers

ASFWS 2012 - Obfuscator, ou comment durcir un code source ou un binaire contr...
ASFWS 2012 - Obfuscator, ou comment durcir un code source ou un binaire contr...ASFWS 2012 - Obfuscator, ou comment durcir un code source ou un binaire contr...
ASFWS 2012 - Obfuscator, ou comment durcir un code source ou un binaire contr...Cyber Security Alliance
 
Data Science for Folks Without (or With!) a Ph.D.
Data Science for Folks Without (or With!) a Ph.D.Data Science for Folks Without (or With!) a Ph.D.
Data Science for Folks Without (or With!) a Ph.D.Douglas Starnes
 
MongoDB Analytics
MongoDB AnalyticsMongoDB Analytics
MongoDB Analyticsdatablend
 
Go Says WAT?
Go Says WAT?Go Says WAT?
Go Says WAT?jonbodner
 
Introduction To Scala
Introduction To ScalaIntroduction To Scala
Introduction To ScalaPeter Maas
 
Flexible Event Tracking (Paul Gebheim)
Flexible Event Tracking (Paul Gebheim)Flexible Event Tracking (Paul Gebheim)
Flexible Event Tracking (Paul Gebheim)MongoSF
 
Introducing Security Access Control Policies into Legacy Business Processes
Introducing Security Access Control Policies into Legacy Business ProcessesIntroducing Security Access Control Policies into Legacy Business Processes
Introducing Security Access Control Policies into Legacy Business ProcessesSébastien Mosser
 
The Moby Scheme Compiler for Smartphones
The Moby Scheme Compiler for SmartphonesThe Moby Scheme Compiler for Smartphones
The Moby Scheme Compiler for Smartphonesguest66441a
 
Big Data Frameworks: A primer on Apache Spark and MapReduce
Big Data Frameworks: A primer on Apache Spark and MapReduceBig Data Frameworks: A primer on Apache Spark and MapReduce
Big Data Frameworks: A primer on Apache Spark and MapReduceNitinder Mohan
 
Improve Your Salesforce Efficiency: Formulas for the Everyday Admin
Improve Your Salesforce Efficiency: Formulas for the Everyday AdminImprove Your Salesforce Efficiency: Formulas for the Everyday Admin
Improve Your Salesforce Efficiency: Formulas for the Everyday AdminEve Lyons-Berg
 
Improve Your Salesforce Efficiency: Formulas for the Everyday Admin
Improve Your Salesforce Efficiency: Formulas for the Everyday AdminImprove Your Salesforce Efficiency: Formulas for the Everyday Admin
Improve Your Salesforce Efficiency: Formulas for the Everyday AdminAggregage
 
Rocky Nevin's presentation at eComm 2008
Rocky Nevin's presentation at eComm 2008Rocky Nevin's presentation at eComm 2008
Rocky Nevin's presentation at eComm 2008eComm2008
 
Being functional in PHP (PHPDay Italy 2016)
Being functional in PHP (PHPDay Italy 2016)Being functional in PHP (PHPDay Italy 2016)
Being functional in PHP (PHPDay Italy 2016)David de Boer
 
An Exploration of the Formal Properties of PromQL
An Exploration of the Formal Properties of PromQLAn Exploration of the Formal Properties of PromQL
An Exploration of the Formal Properties of PromQLBrian Brazil
 
Thinking Functionally In Ruby
Thinking Functionally In RubyThinking Functionally In Ruby
Thinking Functionally In RubyRoss Lawley
 
Data Structures and Algorithms
Data Structures and AlgorithmsData Structures and Algorithms
Data Structures and AlgorithmsSNEHAL MASNE
 
[FT-7][snowmantw] How to make a new functional language and make the world be...
[FT-7][snowmantw] How to make a new functional language and make the world be...[FT-7][snowmantw] How to make a new functional language and make the world be...
[FT-7][snowmantw] How to make a new functional language and make the world be...Functional Thursday
 
Batteries included: Advantages of an End-to-end solution
Batteries included: Advantages of an End-to-end solutionBatteries included: Advantages of an End-to-end solution
Batteries included: Advantages of an End-to-end solutionJuergen Fesslmeier
 

Similar to 8 minutes of monad transformers (20)

ASFWS 2012 - Obfuscator, ou comment durcir un code source ou un binaire contr...
ASFWS 2012 - Obfuscator, ou comment durcir un code source ou un binaire contr...ASFWS 2012 - Obfuscator, ou comment durcir un code source ou un binaire contr...
ASFWS 2012 - Obfuscator, ou comment durcir un code source ou un binaire contr...
 
Data Science for Folks Without (or With!) a Ph.D.
Data Science for Folks Without (or With!) a Ph.D.Data Science for Folks Without (or With!) a Ph.D.
Data Science for Folks Without (or With!) a Ph.D.
 
201106 WICSA
201106 WICSA201106 WICSA
201106 WICSA
 
MongoDB Analytics
MongoDB AnalyticsMongoDB Analytics
MongoDB Analytics
 
Go Says WAT?
Go Says WAT?Go Says WAT?
Go Says WAT?
 
Introduction To Scala
Introduction To ScalaIntroduction To Scala
Introduction To Scala
 
Flexible Event Tracking (Paul Gebheim)
Flexible Event Tracking (Paul Gebheim)Flexible Event Tracking (Paul Gebheim)
Flexible Event Tracking (Paul Gebheim)
 
Introducing Security Access Control Policies into Legacy Business Processes
Introducing Security Access Control Policies into Legacy Business ProcessesIntroducing Security Access Control Policies into Legacy Business Processes
Introducing Security Access Control Policies into Legacy Business Processes
 
The Moby Scheme Compiler for Smartphones
The Moby Scheme Compiler for SmartphonesThe Moby Scheme Compiler for Smartphones
The Moby Scheme Compiler for Smartphones
 
Big Data Frameworks: A primer on Apache Spark and MapReduce
Big Data Frameworks: A primer on Apache Spark and MapReduceBig Data Frameworks: A primer on Apache Spark and MapReduce
Big Data Frameworks: A primer on Apache Spark and MapReduce
 
Practical Magic with Incanter
Practical Magic with IncanterPractical Magic with Incanter
Practical Magic with Incanter
 
Improve Your Salesforce Efficiency: Formulas for the Everyday Admin
Improve Your Salesforce Efficiency: Formulas for the Everyday AdminImprove Your Salesforce Efficiency: Formulas for the Everyday Admin
Improve Your Salesforce Efficiency: Formulas for the Everyday Admin
 
Improve Your Salesforce Efficiency: Formulas for the Everyday Admin
Improve Your Salesforce Efficiency: Formulas for the Everyday AdminImprove Your Salesforce Efficiency: Formulas for the Everyday Admin
Improve Your Salesforce Efficiency: Formulas for the Everyday Admin
 
Rocky Nevin's presentation at eComm 2008
Rocky Nevin's presentation at eComm 2008Rocky Nevin's presentation at eComm 2008
Rocky Nevin's presentation at eComm 2008
 
Being functional in PHP (PHPDay Italy 2016)
Being functional in PHP (PHPDay Italy 2016)Being functional in PHP (PHPDay Italy 2016)
Being functional in PHP (PHPDay Italy 2016)
 
An Exploration of the Formal Properties of PromQL
An Exploration of the Formal Properties of PromQLAn Exploration of the Formal Properties of PromQL
An Exploration of the Formal Properties of PromQL
 
Thinking Functionally In Ruby
Thinking Functionally In RubyThinking Functionally In Ruby
Thinking Functionally In Ruby
 
Data Structures and Algorithms
Data Structures and AlgorithmsData Structures and Algorithms
Data Structures and Algorithms
 
[FT-7][snowmantw] How to make a new functional language and make the world be...
[FT-7][snowmantw] How to make a new functional language and make the world be...[FT-7][snowmantw] How to make a new functional language and make the world be...
[FT-7][snowmantw] How to make a new functional language and make the world be...
 
Batteries included: Advantages of an End-to-end solution
Batteries included: Advantages of an End-to-end solutionBatteries included: Advantages of an End-to-end solution
Batteries included: Advantages of an End-to-end solution
 

Recently uploaded

TechTAC® CFD Report Summary: A Comparison of Two Types of Tubing Anchor Catchers
TechTAC® CFD Report Summary: A Comparison of Two Types of Tubing Anchor CatchersTechTAC® CFD Report Summary: A Comparison of Two Types of Tubing Anchor Catchers
TechTAC® CFD Report Summary: A Comparison of Two Types of Tubing Anchor Catcherssdickerson1
 
Engineering Drawing section of solid
Engineering Drawing     section of solidEngineering Drawing     section of solid
Engineering Drawing section of solidnamansinghjarodiya
 
Transport layer issues and challenges - Guide
Transport layer issues and challenges - GuideTransport layer issues and challenges - Guide
Transport layer issues and challenges - GuideGOPINATHS437943
 
Indian Dairy Industry Present Status and.ppt
Indian Dairy Industry Present Status and.pptIndian Dairy Industry Present Status and.ppt
Indian Dairy Industry Present Status and.pptMadan Karki
 
Ch10-Global Supply Chain - Cadena de Suministro.pdf
Ch10-Global Supply Chain - Cadena de Suministro.pdfCh10-Global Supply Chain - Cadena de Suministro.pdf
Ch10-Global Supply Chain - Cadena de Suministro.pdfChristianCDAM
 
Input Output Management in Operating System
Input Output Management in Operating SystemInput Output Management in Operating System
Input Output Management in Operating SystemRashmi Bhat
 
"Exploring the Essential Functions and Design Considerations of Spillways in ...
"Exploring the Essential Functions and Design Considerations of Spillways in ..."Exploring the Essential Functions and Design Considerations of Spillways in ...
"Exploring the Essential Functions and Design Considerations of Spillways in ...Erbil Polytechnic University
 
IVE Industry Focused Event - Defence Sector 2024
IVE Industry Focused Event - Defence Sector 2024IVE Industry Focused Event - Defence Sector 2024
IVE Industry Focused Event - Defence Sector 2024Mark Billinghurst
 
Internet of things -Arshdeep Bahga .pptx
Internet of things -Arshdeep Bahga .pptxInternet of things -Arshdeep Bahga .pptx
Internet of things -Arshdeep Bahga .pptxVelmuruganTECE
 
Past, Present and Future of Generative AI
Past, Present and Future of Generative AIPast, Present and Future of Generative AI
Past, Present and Future of Generative AIabhishek36461
 
Comparative study of High-rise Building Using ETABS,SAP200 and SAFE., SAFE an...
Comparative study of High-rise Building Using ETABS,SAP200 and SAFE., SAFE an...Comparative study of High-rise Building Using ETABS,SAP200 and SAFE., SAFE an...
Comparative study of High-rise Building Using ETABS,SAP200 and SAFE., SAFE an...Erbil Polytechnic University
 
Virtual memory management in Operating System
Virtual memory management in Operating SystemVirtual memory management in Operating System
Virtual memory management in Operating SystemRashmi Bhat
 
Arduino_CSE ece ppt for working and principal of arduino.ppt
Arduino_CSE ece ppt for working and principal of arduino.pptArduino_CSE ece ppt for working and principal of arduino.ppt
Arduino_CSE ece ppt for working and principal of arduino.pptSAURABHKUMAR892774
 
Autonomous emergency braking system (aeb) ppt.ppt
Autonomous emergency braking system (aeb) ppt.pptAutonomous emergency braking system (aeb) ppt.ppt
Autonomous emergency braking system (aeb) ppt.pptbibisarnayak0
 
Main Memory Management in Operating System
Main Memory Management in Operating SystemMain Memory Management in Operating System
Main Memory Management in Operating SystemRashmi Bhat
 
Software and Systems Engineering Standards: Verification and Validation of Sy...
Software and Systems Engineering Standards: Verification and Validation of Sy...Software and Systems Engineering Standards: Verification and Validation of Sy...
Software and Systems Engineering Standards: Verification and Validation of Sy...VICTOR MAESTRE RAMIREZ
 
THE SENDAI FRAMEWORK FOR DISASTER RISK REDUCTION
THE SENDAI FRAMEWORK FOR DISASTER RISK REDUCTIONTHE SENDAI FRAMEWORK FOR DISASTER RISK REDUCTION
THE SENDAI FRAMEWORK FOR DISASTER RISK REDUCTIONjhunlian
 
Work Experience-Dalton Park.pptxfvvvvvvv
Work Experience-Dalton Park.pptxfvvvvvvvWork Experience-Dalton Park.pptxfvvvvvvv
Work Experience-Dalton Park.pptxfvvvvvvvLewisJB
 
Crushers to screens in aggregate production
Crushers to screens in aggregate productionCrushers to screens in aggregate production
Crushers to screens in aggregate productionChinnuNinan
 

Recently uploaded (20)

TechTAC® CFD Report Summary: A Comparison of Two Types of Tubing Anchor Catchers
TechTAC® CFD Report Summary: A Comparison of Two Types of Tubing Anchor CatchersTechTAC® CFD Report Summary: A Comparison of Two Types of Tubing Anchor Catchers
TechTAC® CFD Report Summary: A Comparison of Two Types of Tubing Anchor Catchers
 
Engineering Drawing section of solid
Engineering Drawing     section of solidEngineering Drawing     section of solid
Engineering Drawing section of solid
 
Transport layer issues and challenges - Guide
Transport layer issues and challenges - GuideTransport layer issues and challenges - Guide
Transport layer issues and challenges - Guide
 
Indian Dairy Industry Present Status and.ppt
Indian Dairy Industry Present Status and.pptIndian Dairy Industry Present Status and.ppt
Indian Dairy Industry Present Status and.ppt
 
Ch10-Global Supply Chain - Cadena de Suministro.pdf
Ch10-Global Supply Chain - Cadena de Suministro.pdfCh10-Global Supply Chain - Cadena de Suministro.pdf
Ch10-Global Supply Chain - Cadena de Suministro.pdf
 
Input Output Management in Operating System
Input Output Management in Operating SystemInput Output Management in Operating System
Input Output Management in Operating System
 
"Exploring the Essential Functions and Design Considerations of Spillways in ...
"Exploring the Essential Functions and Design Considerations of Spillways in ..."Exploring the Essential Functions and Design Considerations of Spillways in ...
"Exploring the Essential Functions and Design Considerations of Spillways in ...
 
IVE Industry Focused Event - Defence Sector 2024
IVE Industry Focused Event - Defence Sector 2024IVE Industry Focused Event - Defence Sector 2024
IVE Industry Focused Event - Defence Sector 2024
 
Design and analysis of solar grass cutter.pdf
Design and analysis of solar grass cutter.pdfDesign and analysis of solar grass cutter.pdf
Design and analysis of solar grass cutter.pdf
 
Internet of things -Arshdeep Bahga .pptx
Internet of things -Arshdeep Bahga .pptxInternet of things -Arshdeep Bahga .pptx
Internet of things -Arshdeep Bahga .pptx
 
Past, Present and Future of Generative AI
Past, Present and Future of Generative AIPast, Present and Future of Generative AI
Past, Present and Future of Generative AI
 
Comparative study of High-rise Building Using ETABS,SAP200 and SAFE., SAFE an...
Comparative study of High-rise Building Using ETABS,SAP200 and SAFE., SAFE an...Comparative study of High-rise Building Using ETABS,SAP200 and SAFE., SAFE an...
Comparative study of High-rise Building Using ETABS,SAP200 and SAFE., SAFE an...
 
Virtual memory management in Operating System
Virtual memory management in Operating SystemVirtual memory management in Operating System
Virtual memory management in Operating System
 
Arduino_CSE ece ppt for working and principal of arduino.ppt
Arduino_CSE ece ppt for working and principal of arduino.pptArduino_CSE ece ppt for working and principal of arduino.ppt
Arduino_CSE ece ppt for working and principal of arduino.ppt
 
Autonomous emergency braking system (aeb) ppt.ppt
Autonomous emergency braking system (aeb) ppt.pptAutonomous emergency braking system (aeb) ppt.ppt
Autonomous emergency braking system (aeb) ppt.ppt
 
Main Memory Management in Operating System
Main Memory Management in Operating SystemMain Memory Management in Operating System
Main Memory Management in Operating System
 
Software and Systems Engineering Standards: Verification and Validation of Sy...
Software and Systems Engineering Standards: Verification and Validation of Sy...Software and Systems Engineering Standards: Verification and Validation of Sy...
Software and Systems Engineering Standards: Verification and Validation of Sy...
 
THE SENDAI FRAMEWORK FOR DISASTER RISK REDUCTION
THE SENDAI FRAMEWORK FOR DISASTER RISK REDUCTIONTHE SENDAI FRAMEWORK FOR DISASTER RISK REDUCTION
THE SENDAI FRAMEWORK FOR DISASTER RISK REDUCTION
 
Work Experience-Dalton Park.pptxfvvvvvvv
Work Experience-Dalton Park.pptxfvvvvvvvWork Experience-Dalton Park.pptxfvvvvvvv
Work Experience-Dalton Park.pptxfvvvvvvv
 
Crushers to screens in aggregate production
Crushers to screens in aggregate productionCrushers to screens in aggregate production
Crushers to screens in aggregate production
 

8 minutes of monad transformers

  • 1. 8 MINUTES OF MONAD TRANSFORMERS THINGS THAT YOU ARE AFRAID TO ASK HASKELL DEVELOPERS
  • 2. ...you don't need to know what is it in case of this topic. MONADS 8MINUTESOF MONADTRANSFORMERS Future("1")        .map(_ + "0")        .map(_.toInt) // result: 10 List("1", "2", "3", "4")        .map(_.toInt)        .map(_ * 2) // result: [2, 4, 6, 8]
  • 3. ...you don't need to know what is it in case of this topic. MONADS 8MINUTESOF MONADTRANSFORMERS Future("1")        .map(_ + "0")        .map(_.toInt) // result: 10 List("1", "2", "3", "4")        .map(_.toInt)        .map(_ * 2) // result: 2, 4, 6, 8
  • 4. ...you don't need to know what is it in case of this topic. MONAD 8MINUTESOF MONADTRANSFORMERS Future(List("1", "2", "3"))        .map(???)
  • 5. ...way to use nested monads. MONAD T 8MINUTESOF MONADTRANSFORMERS Future(List("1", "2", "3"))        .map(_.map(doSmth))
  • 6. ...way to use nested monads. MONAD T 8MINUTESOF MONADTRANSFORMERS implicit class FutureListMonadT[A](a: Future[List[A]]) {     def mapT[B](f: A => B): Future[List[B]] =          a.map(_.map(f)) } Future(List("1", "2", "3"))       .mapT(doSmth)