In functional programming, a monad is a structure that represents computations defined as sequences of steps: a type with a monad structure defines what it means to chain operations, or nest functions of that type together. This allows the programmer to build pipelines that process data in steps, in which each action is decorated with additional processing rules provided by the monad. As such, monads have been described as "programmable semicolons"; a semicolon is the operator used to chain together individual statements in many imperative programming languages, thus the expression implies that extra code will be executed between the statements in the pipeline. Monads have also been explained with a physical metaphor as assembly lines, where a conveyor belt transports data between functional units that transform it one step at a time. They can also be seen as a functional design pattern to build generic types.
Purely functional programs can use monads to structure procedures that include sequenced operations like those found in structured programming. Many common programming concepts can be described in terms of a monad structure, including side effects such as input/output, variable assignment, exception handling, parsing, nondeterminism, concurrency, and continuations. This allows these concepts to be defined in a purely functional manner, without major extensions to the language's semantics. Languages like Haskell provide monads in the standard core, allowing programmers to reuse large parts of their formal definition and apply in many different libraries the same interfaces for combining functions.
In computer science, functional programming 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. It is a declarative programming paradigm, which means programming is done with expressions. In functional code, the output value of a function depends only on the arguments that are input to the function, so calling a function f twice with the same value for an argument x will produce the same result f(x) each time. Eliminating side effects, i.e. changes in state that do not depend on the function inputs, can make it much easier to understand and predict the behavior of a program, which is one of the key motivations for the development of functional programming.
Programming often relies on combining functions in data pipelines. The monad is a design pattern which makes pipelines with effect much easier to write and maintain.
Monads are often explained using haskell in complicated ways but I tried here to simply explain the pattern with javascript to build an intuition of them.
published: 26 Jun 2022
The Absolute Best Intro to Monads For Software Engineers
If you had to pick the most inaccessible terms in all of software engineering, monad would be a strong contender for first place, because of its spooky math background that uses terms like endofunctor and monoid. As it turns out, monads are an extremely powerful design pattern that can be used without any math knowledge. In this video, we’ll cover what monads are, how they can be incredibly useful, and examine some common monads. All you need is a little software engineering knowledge. Let's go!
Dr. Strange Icon Credit: https://dribbble.com/dalius-stuoka
00:00 Intro
00:29 Basic Code
01:45 Issue #1
02:38 Issue #2
04:11 Putting It All Together
05:15 Properties of Monads
06:05 The Option Monad
09:14 Monads Hide Work Behind The Scenes
11:21 Common Monads
12:10 The List Monad
13:56 Recap
published: 28 Dec 2021
What is a Monad? - The Last Monad Intro You'll Ever Need
example code and readings: https://github.com/imjamesku/monad-video-examples
0:00 intro
0:47 Revisit array map
1:20 flatMap
2:52 Represent effects with types
5:24 What is a monad?
6:44 How does Promises relate to Monads?
7:40 Monads vs. Functors
7:59 do notation
9:08 Promise example
9:21 Array example
10:39 Maybe example
11:42 Writer example
14:39 Recap
15:23 Additional reading
Icons: www.flaticon.com
illustrations:https://www.irasutoya.com/
B-roll:envato elements
published: 12 Oct 2023
What is a Monad? - Computerphile
Monads sound scary, but Professor Graham Hutton breaks down how handy they can be.
https://www.facebook.com/computerphile
https://twitter.com/computer_phile
This video was filmed and edited by Sean Riley.
Computer Science at the University of Nottingham: https://bit.ly/nottscomputer
Computerphile is a sister project to Brady Haran's Numberphile. More at http://www.bradyharan.com
published: 24 Nov 2017
What the Heck Are Monads?!
Today, I'm going to take a deep dive into monads. They’re a well-known concept in functional programming languages like Haskell, but are they useful elsewhere? Stay tuned, and by the end of this video, you'll understand what monads are all about.
👷 Join the FREE Code Diagnosis Workshop to help you review code more effectively using my 3-Factor Diagnosis Framework: https://www.arjancodes.com/diagnosis
💻 ArjanCodes Blog: https://www.arjancodes.com/blog
Git repository: https://git.arjan.codes/2023/monad
✍🏻 Take a quiz on this topic: https://www.learntail.com/quiz/ynkzgi
Try Learntail for FREE ➡️ https://www.learntail.com/
🎓 Courses:
The Software Designer Mindset: https://www.arjancodes.com/mindset
The Software Architect Mindset: Pre-register now! https://www.arjancodes.com/architect
Nex...
published: 10 Nov 2023
Haskell: Monads. A 5-minute introduction
Yet another take on "what's a monad" in Haskell.
published: 03 Oct 2020
No Nonsense Monad & Functor - The foundation of Functional Programming by César Tron-Lozai
For more info on the next Devoxx UK 👉 https://www.devoxx.co.uk
What the ƒ is a Monad? If this question has kept you up at night, this talk is for you.
Monads are a key part of Functional Programming. They allow us to write clean, composable code and removes boilerplate.
Yet, monads are feared by many. Here I will debunk their mythical complexity.
In this talk we will explore two of the foundations of Functional Programming: functors and monads. We will look at Functional Programming from a theoretical perspective, but we won’t get lost in mathematical details. Using simple diagrams and practical examples we will build a clear understanding of monads. This is the perfect talk for anyone that feels baffled by functional programming!
published: 06 Jan 2022
An Intuitive Introduction to Monads in Under 10 Minutes
(Don't worry, I'll be back with smw stuff now. I just needed to make this tutorial because the computerphile video was bothering me)
published: 15 Dec 2017
Haskell in 100 Seconds
Haskell is a purely functional programming language based on lambda calculus. It uses immutable values and expressions to produce terse code that is suitable for general-purpose software applications.
#programming #compsci #100SecondsOfCode
🔗 Resources
Haskell Docs https://www.haskell.org/
Haskell Wiki https://wiki.haskell.org/
Monad Graphic https://stackoverflow.com/questions/9345008/why-doesnt-scala-have-an-io-monad
🔥 Get More Content - Upgrade to PRO
Upgrade to Fireship PRO at https://fireship.io/pro
Use code lORhwXd2 for 25% off your first payment.
🎨 My Editor Settings
- Atom One Dark
- vscode-icons
- Fira Code Font
🔖 Topics Covered
- Haskell Basics Tutorial
- Functional programming concepts
- Who is Haskell Curry?
- What is Haskell used for?
- What is a Monad?
published: 29 Nov 2021
Brian Beckman: Don't fear the Monad
Cross posted from msdn's channel 9.
Functional programming is increasing in popularity these days given the inherent problems with shared mutable state that is rife in the imperative world. As we march on to a world of multi and many-core chipsets, software engineering must evolve to better equip software engineers with the tools to exploit the vast power of multiple core processors as it won't come for free as it did in the recent past which was predictably based on Moore's law.
Of course, learning new ways to think about programming semantics and code patterns are not always straight forward. For example, most imperative programmers (which include most of us who build software for a living...) are somewhat perplexed by the notion of functions as first class data structures that can be ...
Programming often relies on combining functions in data pipelines. The monad is a design pattern which makes pipelines with effect much easier to write and main...
Programming often relies on combining functions in data pipelines. The monad is a design pattern which makes pipelines with effect much easier to write and maintain.
Monads are often explained using haskell in complicated ways but I tried here to simply explain the pattern with javascript to build an intuition of them.
Programming often relies on combining functions in data pipelines. The monad is a design pattern which makes pipelines with effect much easier to write and maintain.
Monads are often explained using haskell in complicated ways but I tried here to simply explain the pattern with javascript to build an intuition of them.
If you had to pick the most inaccessible terms in all of software engineering, monad would be a strong contender for first place, because of its spooky math bac...
If you had to pick the most inaccessible terms in all of software engineering, monad would be a strong contender for first place, because of its spooky math background that uses terms like endofunctor and monoid. As it turns out, monads are an extremely powerful design pattern that can be used without any math knowledge. In this video, we’ll cover what monads are, how they can be incredibly useful, and examine some common monads. All you need is a little software engineering knowledge. Let's go!
Dr. Strange Icon Credit: https://dribbble.com/dalius-stuoka
00:00 Intro
00:29 Basic Code
01:45 Issue #1
02:38 Issue #2
04:11 Putting It All Together
05:15 Properties of Monads
06:05 The Option Monad
09:14 Monads Hide Work Behind The Scenes
11:21 Common Monads
12:10 The List Monad
13:56 Recap
If you had to pick the most inaccessible terms in all of software engineering, monad would be a strong contender for first place, because of its spooky math background that uses terms like endofunctor and monoid. As it turns out, monads are an extremely powerful design pattern that can be used without any math knowledge. In this video, we’ll cover what monads are, how they can be incredibly useful, and examine some common monads. All you need is a little software engineering knowledge. Let's go!
Dr. Strange Icon Credit: https://dribbble.com/dalius-stuoka
00:00 Intro
00:29 Basic Code
01:45 Issue #1
02:38 Issue #2
04:11 Putting It All Together
05:15 Properties of Monads
06:05 The Option Monad
09:14 Monads Hide Work Behind The Scenes
11:21 Common Monads
12:10 The List Monad
13:56 Recap
example code and readings: https://github.com/imjamesku/monad-video-examples
0:00 intro
0:47 Revisit array map
1:20 flatMap
2:52 Represent effects with types
5...
example code and readings: https://github.com/imjamesku/monad-video-examples
0:00 intro
0:47 Revisit array map
1:20 flatMap
2:52 Represent effects with types
5:24 What is a monad?
6:44 How does Promises relate to Monads?
7:40 Monads vs. Functors
7:59 do notation
9:08 Promise example
9:21 Array example
10:39 Maybe example
11:42 Writer example
14:39 Recap
15:23 Additional reading
Icons: www.flaticon.com
illustrations:https://www.irasutoya.com/
B-roll:envato elements
example code and readings: https://github.com/imjamesku/monad-video-examples
0:00 intro
0:47 Revisit array map
1:20 flatMap
2:52 Represent effects with types
5:24 What is a monad?
6:44 How does Promises relate to Monads?
7:40 Monads vs. Functors
7:59 do notation
9:08 Promise example
9:21 Array example
10:39 Maybe example
11:42 Writer example
14:39 Recap
15:23 Additional reading
Icons: www.flaticon.com
illustrations:https://www.irasutoya.com/
B-roll:envato elements
Monads sound scary, but Professor Graham Hutton breaks down how handy they can be.
https://www.facebook.com/computerphile
https://twitter.com/computer_phile
...
Monads sound scary, but Professor Graham Hutton breaks down how handy they can be.
https://www.facebook.com/computerphile
https://twitter.com/computer_phile
This video was filmed and edited by Sean Riley.
Computer Science at the University of Nottingham: https://bit.ly/nottscomputer
Computerphile is a sister project to Brady Haran's Numberphile. More at http://www.bradyharan.com
Monads sound scary, but Professor Graham Hutton breaks down how handy they can be.
https://www.facebook.com/computerphile
https://twitter.com/computer_phile
This video was filmed and edited by Sean Riley.
Computer Science at the University of Nottingham: https://bit.ly/nottscomputer
Computerphile is a sister project to Brady Haran's Numberphile. More at http://www.bradyharan.com
Today, I'm going to take a deep dive into monads. They’re a well-known concept in functional programming languages like Haskell, but are they useful elsewhere? ...
Today, I'm going to take a deep dive into monads. They’re a well-known concept in functional programming languages like Haskell, but are they useful elsewhere? Stay tuned, and by the end of this video, you'll understand what monads are all about.
👷 Join the FREE Code Diagnosis Workshop to help you review code more effectively using my 3-Factor Diagnosis Framework: https://www.arjancodes.com/diagnosis
💻 ArjanCodes Blog: https://www.arjancodes.com/blog
Git repository: https://git.arjan.codes/2023/monad
✍🏻 Take a quiz on this topic: https://www.learntail.com/quiz/ynkzgi
Try Learntail for FREE ➡️ https://www.learntail.com/
🎓 Courses:
The Software Designer Mindset: https://www.arjancodes.com/mindset
The Software Architect Mindset: Pre-register now! https://www.arjancodes.com/architect
Next Level Python: Become a Python Expert: https://www.arjancodes.com/next-level-python
The 30-Day Design Challenge: https://www.arjancodes.com/30ddc
🛒 GEAR & RECOMMENDED BOOKS: https://kit.co/arjancodes.
👍 If you enjoyed this content, give this video a like. If you want to watch more of my upcoming videos, consider subscribing to my channel!
Social channels:
💬 Discord: https://discord.arjan.codes
🐦Twitter: https://twitter.com/arjancodes
🌍LinkedIn: https://www.linkedin.com/company/arjancodes
🕵Facebook: https://www.facebook.com/arjancodes
📱Instagram: https://www.instagram.com/arjancodes
♪ Tiktok: https://www.tiktok.com/@arjancodes
👀 Code reviewers:
- Yoriz
- Ryan Laursen
- Dale Hagglund
🎥 Video edited by Mark Bacskai: https://www.instagram.com/bacskaimark
🔖 Chapters:
0:00 Intro
1:19 What is a monad?
1:41 Step 1: Understanding Functors
2:53 Step 2: Understanding Endofunctors
4:00 Why is Functor an Endofunctor?
6:22 Step 3: Understanding Monoids
7:15 Step 4: Monads as Monoids in the Category of Endofunctors
11:50 Maybe monad
19:12 Should we switch to monads?
20:36 Outro
#arjancodes #softwaredesign #python
DISCLAIMER - The links in this description might be affiliate links. If you purchase a product or service through one of those links, I may receive a small commission. There is no additional charge to you. Thanks for supporting my channel so I can continue to provide you with free content each week!
Today, I'm going to take a deep dive into monads. They’re a well-known concept in functional programming languages like Haskell, but are they useful elsewhere? Stay tuned, and by the end of this video, you'll understand what monads are all about.
👷 Join the FREE Code Diagnosis Workshop to help you review code more effectively using my 3-Factor Diagnosis Framework: https://www.arjancodes.com/diagnosis
💻 ArjanCodes Blog: https://www.arjancodes.com/blog
Git repository: https://git.arjan.codes/2023/monad
✍🏻 Take a quiz on this topic: https://www.learntail.com/quiz/ynkzgi
Try Learntail for FREE ➡️ https://www.learntail.com/
🎓 Courses:
The Software Designer Mindset: https://www.arjancodes.com/mindset
The Software Architect Mindset: Pre-register now! https://www.arjancodes.com/architect
Next Level Python: Become a Python Expert: https://www.arjancodes.com/next-level-python
The 30-Day Design Challenge: https://www.arjancodes.com/30ddc
🛒 GEAR & RECOMMENDED BOOKS: https://kit.co/arjancodes.
👍 If you enjoyed this content, give this video a like. If you want to watch more of my upcoming videos, consider subscribing to my channel!
Social channels:
💬 Discord: https://discord.arjan.codes
🐦Twitter: https://twitter.com/arjancodes
🌍LinkedIn: https://www.linkedin.com/company/arjancodes
🕵Facebook: https://www.facebook.com/arjancodes
📱Instagram: https://www.instagram.com/arjancodes
♪ Tiktok: https://www.tiktok.com/@arjancodes
👀 Code reviewers:
- Yoriz
- Ryan Laursen
- Dale Hagglund
🎥 Video edited by Mark Bacskai: https://www.instagram.com/bacskaimark
🔖 Chapters:
0:00 Intro
1:19 What is a monad?
1:41 Step 1: Understanding Functors
2:53 Step 2: Understanding Endofunctors
4:00 Why is Functor an Endofunctor?
6:22 Step 3: Understanding Monoids
7:15 Step 4: Monads as Monoids in the Category of Endofunctors
11:50 Maybe monad
19:12 Should we switch to monads?
20:36 Outro
#arjancodes #softwaredesign #python
DISCLAIMER - The links in this description might be affiliate links. If you purchase a product or service through one of those links, I may receive a small commission. There is no additional charge to you. Thanks for supporting my channel so I can continue to provide you with free content each week!
For more info on the next Devoxx UK 👉 https://www.devoxx.co.uk
What the ƒ is a Monad? If this question has kept you up at night, this talk is for you.
Monads...
For more info on the next Devoxx UK 👉 https://www.devoxx.co.uk
What the ƒ is a Monad? If this question has kept you up at night, this talk is for you.
Monads are a key part of Functional Programming. They allow us to write clean, composable code and removes boilerplate.
Yet, monads are feared by many. Here I will debunk their mythical complexity.
In this talk we will explore two of the foundations of Functional Programming: functors and monads. We will look at Functional Programming from a theoretical perspective, but we won’t get lost in mathematical details. Using simple diagrams and practical examples we will build a clear understanding of monads. This is the perfect talk for anyone that feels baffled by functional programming!
For more info on the next Devoxx UK 👉 https://www.devoxx.co.uk
What the ƒ is a Monad? If this question has kept you up at night, this talk is for you.
Monads are a key part of Functional Programming. They allow us to write clean, composable code and removes boilerplate.
Yet, monads are feared by many. Here I will debunk their mythical complexity.
In this talk we will explore two of the foundations of Functional Programming: functors and monads. We will look at Functional Programming from a theoretical perspective, but we won’t get lost in mathematical details. Using simple diagrams and practical examples we will build a clear understanding of monads. This is the perfect talk for anyone that feels baffled by functional programming!
Haskell is a purely functional programming language based on lambda calculus. It uses immutable values and expressions to produce terse code that is suitable fo...
Haskell is a purely functional programming language based on lambda calculus. It uses immutable values and expressions to produce terse code that is suitable for general-purpose software applications.
#programming #compsci #100SecondsOfCode
🔗 Resources
Haskell Docs https://www.haskell.org/
Haskell Wiki https://wiki.haskell.org/
Monad Graphic https://stackoverflow.com/questions/9345008/why-doesnt-scala-have-an-io-monad
🔥 Get More Content - Upgrade to PRO
Upgrade to Fireship PRO at https://fireship.io/pro
Use code lORhwXd2 for 25% off your first payment.
🎨 My Editor Settings
- Atom One Dark
- vscode-icons
- Fira Code Font
🔖 Topics Covered
- Haskell Basics Tutorial
- Functional programming concepts
- Who is Haskell Curry?
- What is Haskell used for?
- What is a Monad?
Haskell is a purely functional programming language based on lambda calculus. It uses immutable values and expressions to produce terse code that is suitable for general-purpose software applications.
#programming #compsci #100SecondsOfCode
🔗 Resources
Haskell Docs https://www.haskell.org/
Haskell Wiki https://wiki.haskell.org/
Monad Graphic https://stackoverflow.com/questions/9345008/why-doesnt-scala-have-an-io-monad
🔥 Get More Content - Upgrade to PRO
Upgrade to Fireship PRO at https://fireship.io/pro
Use code lORhwXd2 for 25% off your first payment.
🎨 My Editor Settings
- Atom One Dark
- vscode-icons
- Fira Code Font
🔖 Topics Covered
- Haskell Basics Tutorial
- Functional programming concepts
- Who is Haskell Curry?
- What is Haskell used for?
- What is a Monad?
Cross posted from msdn's channel 9.
Functional programming is increasing in popularity these days given the inherent problems with shared mutable state that is...
Cross posted from msdn's channel 9.
Functional programming is increasing in popularity these days given the inherent problems with shared mutable state that is rife in the imperative world. As we march on to a world of multi and many-core chipsets, software engineering must evolve to better equip software engineers with the tools to exploit the vast power of multiple core processors as it won't come for free as it did in the recent past which was predictably based on Moore's law.
Of course, learning new ways to think about programming semantics and code patterns are not always straight forward. For example, most imperative programmers (which include most of us who build software for a living...) are somewhat perplexed by the notion of functions as first class data structures that can be combined to create powerful and composable systems. Languages like Haskell are pure functional languages and require programmers to think in a different way, often in a precise mathematical fashion where composing and chaining functions is "the Way".
Dr. Brian Beckman, a Channel 9 celebrity, astrophysicist and senior software engineer thought it would be a very good idea to address the complexity of monads in an easy to understand way: a technical conversation at the whiteboard with yours truly for Channel 9.
This video interview is the result of Brian's idea that he can in fact remove the fear of monads from anybody who pays attention to his explanation. Of course, you can't just cover monads in a vacuum (category theory is not really addressed here) so the context is functional programming (Brian covers functions and composable functional structures (function chains) and of course monoids and then monads).
Tune in. There's a lot to learn here and only Brian can make monads easy to understand for the rest of us!
Cross posted from msdn's channel 9.
Functional programming is increasing in popularity these days given the inherent problems with shared mutable state that is rife in the imperative world. As we march on to a world of multi and many-core chipsets, software engineering must evolve to better equip software engineers with the tools to exploit the vast power of multiple core processors as it won't come for free as it did in the recent past which was predictably based on Moore's law.
Of course, learning new ways to think about programming semantics and code patterns are not always straight forward. For example, most imperative programmers (which include most of us who build software for a living...) are somewhat perplexed by the notion of functions as first class data structures that can be combined to create powerful and composable systems. Languages like Haskell are pure functional languages and require programmers to think in a different way, often in a precise mathematical fashion where composing and chaining functions is "the Way".
Dr. Brian Beckman, a Channel 9 celebrity, astrophysicist and senior software engineer thought it would be a very good idea to address the complexity of monads in an easy to understand way: a technical conversation at the whiteboard with yours truly for Channel 9.
This video interview is the result of Brian's idea that he can in fact remove the fear of monads from anybody who pays attention to his explanation. Of course, you can't just cover monads in a vacuum (category theory is not really addressed here) so the context is functional programming (Brian covers functions and composable functional structures (function chains) and of course monoids and then monads).
Tune in. There's a lot to learn here and only Brian can make monads easy to understand for the rest of us!
Programming often relies on combining functions in data pipelines. The monad is a design pattern which makes pipelines with effect much easier to write and maintain.
Monads are often explained using haskell in complicated ways but I tried here to simply explain the pattern with javascript to build an intuition of them.
If you had to pick the most inaccessible terms in all of software engineering, monad would be a strong contender for first place, because of its spooky math background that uses terms like endofunctor and monoid. As it turns out, monads are an extremely powerful design pattern that can be used without any math knowledge. In this video, we’ll cover what monads are, how they can be incredibly useful, and examine some common monads. All you need is a little software engineering knowledge. Let's go!
Dr. Strange Icon Credit: https://dribbble.com/dalius-stuoka
00:00 Intro
00:29 Basic Code
01:45 Issue #1
02:38 Issue #2
04:11 Putting It All Together
05:15 Properties of Monads
06:05 The Option Monad
09:14 Monads Hide Work Behind The Scenes
11:21 Common Monads
12:10 The List Monad
13:56 Recap
example code and readings: https://github.com/imjamesku/monad-video-examples
0:00 intro
0:47 Revisit array map
1:20 flatMap
2:52 Represent effects with types
5:24 What is a monad?
6:44 How does Promises relate to Monads?
7:40 Monads vs. Functors
7:59 do notation
9:08 Promise example
9:21 Array example
10:39 Maybe example
11:42 Writer example
14:39 Recap
15:23 Additional reading
Icons: www.flaticon.com
illustrations:https://www.irasutoya.com/
B-roll:envato elements
Monads sound scary, but Professor Graham Hutton breaks down how handy they can be.
https://www.facebook.com/computerphile
https://twitter.com/computer_phile
This video was filmed and edited by Sean Riley.
Computer Science at the University of Nottingham: https://bit.ly/nottscomputer
Computerphile is a sister project to Brady Haran's Numberphile. More at http://www.bradyharan.com
Today, I'm going to take a deep dive into monads. They’re a well-known concept in functional programming languages like Haskell, but are they useful elsewhere? Stay tuned, and by the end of this video, you'll understand what monads are all about.
👷 Join the FREE Code Diagnosis Workshop to help you review code more effectively using my 3-Factor Diagnosis Framework: https://www.arjancodes.com/diagnosis
💻 ArjanCodes Blog: https://www.arjancodes.com/blog
Git repository: https://git.arjan.codes/2023/monad
✍🏻 Take a quiz on this topic: https://www.learntail.com/quiz/ynkzgi
Try Learntail for FREE ➡️ https://www.learntail.com/
🎓 Courses:
The Software Designer Mindset: https://www.arjancodes.com/mindset
The Software Architect Mindset: Pre-register now! https://www.arjancodes.com/architect
Next Level Python: Become a Python Expert: https://www.arjancodes.com/next-level-python
The 30-Day Design Challenge: https://www.arjancodes.com/30ddc
🛒 GEAR & RECOMMENDED BOOKS: https://kit.co/arjancodes.
👍 If you enjoyed this content, give this video a like. If you want to watch more of my upcoming videos, consider subscribing to my channel!
Social channels:
💬 Discord: https://discord.arjan.codes
🐦Twitter: https://twitter.com/arjancodes
🌍LinkedIn: https://www.linkedin.com/company/arjancodes
🕵Facebook: https://www.facebook.com/arjancodes
📱Instagram: https://www.instagram.com/arjancodes
♪ Tiktok: https://www.tiktok.com/@arjancodes
👀 Code reviewers:
- Yoriz
- Ryan Laursen
- Dale Hagglund
🎥 Video edited by Mark Bacskai: https://www.instagram.com/bacskaimark
🔖 Chapters:
0:00 Intro
1:19 What is a monad?
1:41 Step 1: Understanding Functors
2:53 Step 2: Understanding Endofunctors
4:00 Why is Functor an Endofunctor?
6:22 Step 3: Understanding Monoids
7:15 Step 4: Monads as Monoids in the Category of Endofunctors
11:50 Maybe monad
19:12 Should we switch to monads?
20:36 Outro
#arjancodes #softwaredesign #python
DISCLAIMER - The links in this description might be affiliate links. If you purchase a product or service through one of those links, I may receive a small commission. There is no additional charge to you. Thanks for supporting my channel so I can continue to provide you with free content each week!
For more info on the next Devoxx UK 👉 https://www.devoxx.co.uk
What the ƒ is a Monad? If this question has kept you up at night, this talk is for you.
Monads are a key part of Functional Programming. They allow us to write clean, composable code and removes boilerplate.
Yet, monads are feared by many. Here I will debunk their mythical complexity.
In this talk we will explore two of the foundations of Functional Programming: functors and monads. We will look at Functional Programming from a theoretical perspective, but we won’t get lost in mathematical details. Using simple diagrams and practical examples we will build a clear understanding of monads. This is the perfect talk for anyone that feels baffled by functional programming!
Haskell is a purely functional programming language based on lambda calculus. It uses immutable values and expressions to produce terse code that is suitable for general-purpose software applications.
#programming #compsci #100SecondsOfCode
🔗 Resources
Haskell Docs https://www.haskell.org/
Haskell Wiki https://wiki.haskell.org/
Monad Graphic https://stackoverflow.com/questions/9345008/why-doesnt-scala-have-an-io-monad
🔥 Get More Content - Upgrade to PRO
Upgrade to Fireship PRO at https://fireship.io/pro
Use code lORhwXd2 for 25% off your first payment.
🎨 My Editor Settings
- Atom One Dark
- vscode-icons
- Fira Code Font
🔖 Topics Covered
- Haskell Basics Tutorial
- Functional programming concepts
- Who is Haskell Curry?
- What is Haskell used for?
- What is a Monad?
Cross posted from msdn's channel 9.
Functional programming is increasing in popularity these days given the inherent problems with shared mutable state that is rife in the imperative world. As we march on to a world of multi and many-core chipsets, software engineering must evolve to better equip software engineers with the tools to exploit the vast power of multiple core processors as it won't come for free as it did in the recent past which was predictably based on Moore's law.
Of course, learning new ways to think about programming semantics and code patterns are not always straight forward. For example, most imperative programmers (which include most of us who build software for a living...) are somewhat perplexed by the notion of functions as first class data structures that can be combined to create powerful and composable systems. Languages like Haskell are pure functional languages and require programmers to think in a different way, often in a precise mathematical fashion where composing and chaining functions is "the Way".
Dr. Brian Beckman, a Channel 9 celebrity, astrophysicist and senior software engineer thought it would be a very good idea to address the complexity of monads in an easy to understand way: a technical conversation at the whiteboard with yours truly for Channel 9.
This video interview is the result of Brian's idea that he can in fact remove the fear of monads from anybody who pays attention to his explanation. Of course, you can't just cover monads in a vacuum (category theory is not really addressed here) so the context is functional programming (Brian covers functions and composable functional structures (function chains) and of course monoids and then monads).
Tune in. There's a lot to learn here and only Brian can make monads easy to understand for the rest of us!
In functional programming, a monad is a structure that represents computations defined as sequences of steps: a type with a monad structure defines what it means to chain operations, or nest functions of that type together. This allows the programmer to build pipelines that process data in steps, in which each action is decorated with additional processing rules provided by the monad. As such, monads have been described as "programmable semicolons"; a semicolon is the operator used to chain together individual statements in many imperative programming languages, thus the expression implies that extra code will be executed between the statements in the pipeline. Monads have also been explained with a physical metaphor as assembly lines, where a conveyor belt transports data between functional units that transform it one step at a time. They can also be seen as a functional design pattern to build generic types.
Purely functional programs can use monads to structure procedures that include sequenced operations like those found in structured programming. Many common programming concepts can be described in terms of a monad structure, including side effects such as input/output, variable assignment, exception handling, parsing, nondeterminism, concurrency, and continuations. This allows these concepts to be defined in a purely functional manner, without major extensions to the language's semantics. Languages like Haskell provide monads in the standard core, allowing programmers to reuse large parts of their formal definition and apply in many different libraries the same interfaces for combining functions.