This document summarizes a presentation on teaching Haskell without requiring an understanding of monads. It argues that emphasizing monads early on causes unnecessary confusion and frustration for beginners. Historically, Haskell was designed to be practical and used in applications, not just academia. However, referring to I/O as the "IO monad" has been hugely misleading and harmful to newcomers, as it leads them to obsess over understanding monads before they are ready. In reality, Haskell's I/O can be easily used without knowing anything about monads.
Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...Ramesh Iyer
In today's fast-changing business world, Companies that adapt and embrace new ideas often need help to keep up with the competition. However, fostering a culture of innovation takes much work. It takes vision, leadership and willingness to take risks in the right proportion. Sachin Dev Duggal, co-founder of Builder.ai, has perfected the art of this balance, creating a company culture where creativity and growth are nurtured at each stage.
UiPath Test Automation using UiPath Test Suite series, part 4DianaGray10
Welcome to UiPath Test Automation using UiPath Test Suite series part 4. In this session, we will cover Test Manager overview along with SAP heatmap.
The UiPath Test Manager overview with SAP heatmap webinar offers a concise yet comprehensive exploration of the role of a Test Manager within SAP environments, coupled with the utilization of heatmaps for effective testing strategies.
Participants will gain insights into the responsibilities, challenges, and best practices associated with test management in SAP projects. Additionally, the webinar delves into the significance of heatmaps as a visual aid for identifying testing priorities, areas of risk, and resource allocation within SAP landscapes. Through this session, attendees can expect to enhance their understanding of test management principles while learning practical approaches to optimize testing processes in SAP environments using heatmap visualization techniques
What will you get from this session?
1. Insights into SAP testing best practices
2. Heatmap utilization for testing
3. Optimization of testing processes
4. Demo
Topics covered:
Execution from the test manager
Orchestrator execution result
Defect reporting
SAP heatmap example with demo
Speaker:
Deepak Rai, Automation Practice Lead, Boundaryless Group and UiPath MVP
Smart TV Buyer Insights Survey 2024 by 91mobiles.pdf91mobiles
91mobiles recently conducted a Smart TV Buyer Insights Survey in which we asked over 3,000 respondents about the TV they own, aspects they look at on a new TV, and their TV buying preferences.
Accelerate your Kubernetes clusters with Varnish CachingThijs Feryn
A presentation about the usage and availability of Varnish on Kubernetes. This talk explores the capabilities of Varnish caching and shows how to use the Varnish Helm chart to deploy it to Kubernetes.
This presentation was delivered at K8SUG Singapore. See https://feryn.eu/presentations/accelerate-your-kubernetes-clusters-with-varnish-caching-k8sug-singapore-28-2024 for more details.
Generating a custom Ruby SDK for your web service or Rails API using Smithyg2nightmarescribd
Have you ever wanted a Ruby client API to communicate with your web service? Smithy is a protocol-agnostic language for defining services and SDKs. Smithy Ruby is an implementation of Smithy that generates a Ruby SDK using a Smithy model. In this talk, we will explore Smithy and Smithy Ruby to learn how to generate custom feature-rich SDKs that can communicate with any web service, such as a Rails JSON API.
GraphRAG is All You need? LLM & Knowledge GraphGuy Korland
Guy Korland, CEO and Co-founder of FalkorDB, will review two articles on the integration of language models with knowledge graphs.
1. Unifying Large Language Models and Knowledge Graphs: A Roadmap.
https://arxiv.org/abs/2306.08302
2. Microsoft Research's GraphRAG paper and a review paper on various uses of knowledge graphs:
https://www.microsoft.com/en-us/research/blog/graphrag-unlocking-llm-discovery-on-narrative-private-data/
Securing your Kubernetes cluster_ a step-by-step guide to success !KatiaHIMEUR1
Today, after several years of existence, an extremely active community and an ultra-dynamic ecosystem, Kubernetes has established itself as the de facto standard in container orchestration. Thanks to a wide range of managed services, it has never been so easy to set up a ready-to-use Kubernetes cluster.
However, this ease of use means that the subject of security in Kubernetes is often left for later, or even neglected. This exposes companies to significant risks.
In this talk, I'll show you step-by-step how to secure your Kubernetes cluster for greater peace of mind and reliability.
Connector Corner: Automate dynamic content and events by pushing a buttonDianaGray10
Here is something new! In our next Connector Corner webinar, we will demonstrate how you can use a single workflow to:
Create a campaign using Mailchimp with merge tags/fields
Send an interactive Slack channel message (using buttons)
Have the message received by managers and peers along with a test email for review
But there’s more:
In a second workflow supporting the same use case, you’ll see:
Your campaign sent to target colleagues for approval
If the “Approve” button is clicked, a Jira/Zendesk ticket is created for the marketing design team
But—if the “Reject” button is pushed, colleagues will be alerted via Slack message
Join us to learn more about this new, human-in-the-loop capability, brought to you by Integration Service connectors.
And...
Speakers:
Akshay Agnihotri, Product Manager
Charlie Greenberg, Host
2. This slide is the presentation material used in the LINE Haskell Boot Camp that took
place in Shibuya, Tokyo, on October 28th, 2016.
The latest version of this slide is available at: https://e.xtendo.org/monad
2 / 42
3. Fear, Uncertainty, and Doubt
Haskell is difficult to learn
Monad is difficult, and therefore Haskell is difficult
You need to understand monad in order to use Haskell
You need to understand monad in order to use practical Haskell
Haskell is a mathematical language
Anyways you should learn monad
3 / 42
4. Fear, Uncertainty, and Doubt
Haskell is difficult to learn
Monad is difficult, and therefore Haskell is difficult
You need to understand monad in order to use Haskell
You need to understand monad in order to use practical Haskell
Haskell is a mathematical language
Anyways you should learn monad
None of the above is true.
3 / 42
5. Not my original idea.
Dan Piponi, The IO Monad for People who Simply Don't Care (2007)
Brent Yorgey, Abstraction, intuition, and the “monad tutorial fallacy” (2009)
tora, My how to give a 'monad tutorial' tutorial (2010)
scottw, Why I won't be writing a monad tutorial (2013)
Travis Hance, Write you a monad tutorial (2014)
~kqr, The "What Are Monads?" Fallacy (2015)
Justin Le, IO Monad Considered Harmful (2015)
The community began to recognize the problem: "Why do so many beginning Haskellers
ask the same (wrong) question and go through the same (unnecessary) difficulties?"
4 / 42
6. I've been organizing the South Korean
Haskellers' group for nearly a year
The two most frequently asked question from the newcomers:
5 / 42
7. 1. If Haskell is so great, why's nobody
using it?
6 / 42
10. Pedagogical catastrophe
Ask the Internet, "What is Haskell?"
Purely functional
Lazy
Uses monads
Type classes
etc.
In short, things that newcomers can't possibly have a clue of.
8 / 42
11. Pedagogical catastrophe
Ask the Internet, "What is Haskell?"
Purely functional
Lazy
Uses monads
Type classes
etc.
In short, things that newcomers can't possibly have a clue of.
Using things you don't know in order to teach you something you don't know
8 / 42
12. Pedagogical catastrophe
Ask the Internet, "What is Haskell?"
Purely functional
Lazy
Uses monads
Type classes
etc.
In short, things that newcomers can't possibly have a clue of.
Using things you don't know in order to teach you something you don't know
?!
8 / 42
13. Pedagogical catastrophe
Ask the Internet, "What is Haskell?"
Purely functional
Lazy
Uses monads
Type classes
etc.
In short, things that newcomers can't possibly have a clue of.
Using things you don't know in order to teach you something you don't know
?!
It would be a miracle if there's no massive frustration.
8 / 42
16. Haskell 2010 Report
Preface
[...]
Goals
1. It should be suitable for teaching, research, and applications, including
building large systems.
Explicitly stated goal of usefulness in application development.
10 / 42
18. How the Haskell Committee happened
It is 1987. Non-strict purely functional languages are flooding.
11 / 42
19. How the Haskell Committee happened
It is 1987. Non-strict purely functional languages are flooding.
Too many choices, redundant independent efforts. None is chosen in the market.
11 / 42
20. How the Haskell Committee happened
It is 1987. Non-strict purely functional languages are flooding.
Too many choices, redundant independent efforts. None is chosen in the market.
Purely functional seems to be a good idea, and it's a pity it's not used. Let's unite and
create a language that gets chosen.
11 / 42
21. How the Haskell Committee happened
It is 1987. Non-strict purely functional languages are flooding.
Too many choices, redundant independent efforts. None is chosen in the market.
Purely functional seems to be a good idea, and it's a pity it's not used. Let's unite and
create a language that gets chosen.
In other words, Haskell was not meant to be academia-only.
11 / 42
22. How the Haskell Committee happened
It is 1987. Non-strict purely functional languages are flooding.
Too many choices, redundant independent efforts. None is chosen in the market.
Purely functional seems to be a good idea, and it's a pity it's not used. Let's unite and
create a language that gets chosen.
In other words, Haskell was not meant to be academia-only.
It was designed to be used in real-life.
11 / 42
23. Haskell: A practical tool that solves
real-world problems
A web server with higher performance that the ones written in C
Standard Chartered: "real time pricing, risk management, data analysis, regulatory
systems, desktop and web GUIs, web services, algo pricing, end-user scripting"
Facebook's data access tools and antispam tools
Haskell in finances: ABN AMRO, Bank of America, Barclays, Credit Suisse, Deutsche
Bank, Tsuru Capital
12 / 42
25. Haskell
main = do
putStrLn "Hello. What is your name?"
x <- getLine
putStrLn ("The input was " ++ x)
14 / 42
26. Python
if __name__ == '__main__':
print ('Hello. What is your name?')
x = input()
print ('The input was ' + x)
15 / 42
27. Do the I/O in Haskell. It works.
There is NOTHING special about Haskell's I/O.
Do it as you did in other (imperative) languages.
Deliberately imperative “look and feel”
Simon Peyton Jones, Wearing the hair shirt: a retrospective on Haskell (2003)
We intentionally made it usable imperatively.
The misconception that Haskell's I/O is difficult/special/weird does NOT come from
people who actually tried it.
One phrase caused all tragedy:
16 / 42
29. IO Monad Considered Harmful
Justin Le:
The phrase “IO monad” considered harmful. Please do not use it.
...
I’m going to say that this is probably the single most harmful and damaging
thing in Haskell ...
18 / 42
30. IO Monad Considered Harmful
Justin Le:
The phrase “IO monad” considered harmful. Please do not use it.
...
I’m going to say that this is probably the single most harmful and damaging
thing in Haskell ...
?!
18 / 42
31. Unix commands
echo STRING
cat FILENAME
rm FILENAME
mkdir DIRNAME
echo and cat are commands,
STRING and FILENAME are strings, which are argument for commands.
command and string are different types.
19 / 42
32. Unix pipe
find . | grep ".txt$"
tail -f app.log | grep "^system:" > output.txt
You want to feed the result output of one command as an input to another
command.
20 / 42
33. Haskell's command: action
putStrLn :: String -> IO ()
readFile :: FilePath -> IO String
main = do
x <- readFile "myname.txt"
putStrLn ("Hello, " ++ x ++ "!")
Just as echo is a command that takes one string as its argument, putStrLn is an
action that takes one String.
Just as cat takes a file path as its argument and prints its content, readFile is an
action that takes a FilePath and returns its content as a String.
Actions and Strings are different types.
Actions and the ++ operator are also different types.
21 / 42
34. Haskell's pipe
Haskell's pipe looks like this: >>=
main = readFile "myname.txt" >>= putStrLn
Feed the output of one command as an input of another command.
22 / 42
35. Haskell distinguishes pure functions
and actions by their types
-- pure function
not :: Bool -> Bool
(++) :: [a] -> [a] -> [a]
-- IO action
getLine :: IO String
putStrLn :: String -> IO ()
readFile :: FilePath -> IO String
23 / 42
36. Action is easy. Then why?
Just call them "IO action" or "IO type", and explain they are similar to Unix
commands, and there will be nothing more to teach.
But we call them IO monads and cause this chaos.
Bewildering number of beginners are asking "what is monad?" first. (Because when
programmers see a strange jargon, they just have to understand it. It's their instinct)
"How do I deal with a sequence of multiple numbers in Haskell?"
"Use List." or "Use the List type."
No one replies with "Use the List monad" unless they're pure evil!
Therefore the answer to "How do I do the input/output in Haskell" should also be:
"Use the IO type."
24 / 42
37. Our biggest mistake: Using the scary term “monad” rather than “warm fuzzy
thing”
-- Simon Peyton Jones, Wearing the hair shirt: a retrospective on Haskell
(2003)
25 / 42
39. Historical background
Since when did Haskell have monads?
1987: The Committee is formed. They chose Miranda as the basis.
26 / 42
40. Historical background
Since when did Haskell have monads?
1987: The Committee is formed. They chose Miranda as the basis. No monads.
26 / 42
41. Historical background
Since when did Haskell have monads?
1987: The Committee is formed. They chose Miranda as the basis. No monads.
1990: The Haskell 1.0 report is published.
26 / 42
42. Historical background
Since when did Haskell have monads?
1987: The Committee is formed. They chose Miranda as the basis. No monads.
1990: The Haskell 1.0 report is published. No monads.
26 / 42
43. Historical background
Since when did Haskell have monads?
1987: The Committee is formed. They chose Miranda as the basis. No monads.
1990: The Haskell 1.0 report is published. No monads.
1991: The Haskell 1.1 report is published.
26 / 42
44. Historical background
Since when did Haskell have monads?
1987: The Committee is formed. They chose Miranda as the basis. No monads.
1990: The Haskell 1.0 report is published. No monads.
1991: The Haskell 1.1 report is published. No monads.
26 / 42
45. Historical background
Since when did Haskell have monads?
1987: The Committee is formed. They chose Miranda as the basis. No monads.
1990: The Haskell 1.0 report is published. No monads.
1991: The Haskell 1.1 report is published. No monads.
1992: The Haskell 1.2 report is published.
26 / 42
46. Historical background
Since when did Haskell have monads?
1987: The Committee is formed. They chose Miranda as the basis. No monads.
1990: The Haskell 1.0 report is published. No monads.
1991: The Haskell 1.1 report is published. No monads.
1992: The Haskell 1.2 report is published. No monads.
26 / 42
47. Historical background
Since when did Haskell have monads?
1987: The Committee is formed. They chose Miranda as the basis. No monads.
1990: The Haskell 1.0 report is published. No monads.
1991: The Haskell 1.1 report is published. No monads.
1992: The Haskell 1.2 report is published. No monads.
1996: The Haskell 1.3 report is published.
26 / 42
48. Historical background
Since when did Haskell have monads?
1987: The Committee is formed. They chose Miranda as the basis. No monads.
1990: The Haskell 1.0 report is published. No monads.
1991: The Haskell 1.1 report is published. No monads.
1992: The Haskell 1.2 report is published. No monads.
1996: The Haskell 1.3 report is published. Monadic I/O is introduced.
26 / 42
49. Historical background
Since when did Haskell have monads?
1987: The Committee is formed. They chose Miranda as the basis. No monads.
1990: The Haskell 1.0 report is published. No monads.
1991: The Haskell 1.1 report is published. No monads.
1992: The Haskell 1.2 report is published. No monads.
1996: The Haskell 1.3 report is published. Monadic I/O is introduced.
Monadic I/O has been in use in the community first. (?!)
Haskell 1.3, reflecting such community status, completely abolished the
conventional [Response] -> [Request] I/O and introduced monadic I/O
and the do syntax.
26 / 42
50. The term "monadic I/O" or "IO monad" was originally made to distinguish the new
concept from the old I/O. The term became a new jargon, and the tragedy began.
27 / 42
51. Downfall
Haskell's I/O can be done without monads, and without knowing monads.
You can remove the type class Monad from Haskell and still do the I/O.
Because monad is no more than interface. You only need the >>= function (and
optionally the do notation) redefined I/O only.
You can remove the type class itself and still do the I/O. Because type class is no
more than interface.
But we call them "IO monad" and people immediately look up "monad" first.
If we called them IO type, this step could have been completely skipped.
The community is encouraging the yak shaving, or a "sidequest."
28 / 42
55. JavaScript
>>> ['10', '10', '10'].map(parseInt)
[10, NaN, 2]
Just as you don't need to know JavaScript to use JavaScript
You don't need to understand monad to use Haskell
30 / 42
56. All code of do notation is translated
into monad.
Doesn't that mean monad is a required
concept?
31 / 42
57. All code of do notation is translated
into monad.
Doesn't that mean monad is a required
concept?
Sounds convincing at a glance...
31 / 42
58. All C/C++/D/Rust/Go code is
translated to Assembly.
Therefore, to learn C/C++/D/Rust/Go,
One must learn Assembly first.
32 / 42
59. All C/C++/D/Rust/Go code is
translated to Assembly.
Therefore, to learn C/C++/D/Rust/Go,
One must learn Assembly first.
... But now you see the problem.
32 / 42
61. What is fruit?
When you're trying to explain "What is fruit?" to someone who doesn't know what
fruit is:
Apple is fruit. Orange is fruit. Pear is fruit.
...
Fruit is the seed-bearing structure in angiosperms formed from the ovary after
flowering, normally as a means of botanical reproduction, often edible and juicy with
the sweet or sour taste.
You don't do this.
It is a common intuitive pedagogy to derive abstract concepts from concrete
examples.
34 / 42
62. Even if you do understand...
Understanding the concept called monad, and actually using monadic types (IO, ST,
[], Maybe, ...) are a completely different matter.
Monad in category theory and monad in Haskell are, again, different.
35 / 42
63. Even if you do understand...
Understanding the concept called monad, and actually using monadic types (IO, ST,
[], Maybe, ...) are a completely different matter.
Monad in category theory and monad in Haskell are, again, different.
Attempting to learn how to use monads by understanding what they are is
like asking "What is a musical instrument?" and then assuming once you
know the answer to that, you'll be able to play all of the musical instruments.
~kqr, The "What Are Monads?" Fallacy (2015)
35 / 42
65. So this is what happens
Beginners believe they must understand monad.
36 / 42
66. So this is what happens
Beginners believe they must understand monad.
They can't.
36 / 42
67. So this is what happens
Beginners believe they must understand monad.
They can't. (Most people drop out here)
36 / 42
68. So this is what happens
Beginners believe they must understand monad.
They can't. (Most people drop out here)
They continue to struggle to understand monad while writing codes in Haskell
36 / 42
69. So this is what happens
Beginners believe they must understand monad.
They can't. (Most people drop out here)
They continue to struggle to understand monad while writing codes in Haskell
At some point they do understand what monad is
36 / 42
70. So this is what happens
Beginners believe they must understand monad.
They can't. (Most people drop out here)
They continue to struggle to understand monad while writing codes in Haskell
At some point they do understand what monad is
Then everything feels easy
36 / 42
71. So this is what happens
Beginners believe they must understand monad.
They can't. (Most people drop out here)
They continue to struggle to understand monad while writing codes in Haskell
At some point they do understand what monad is
Then everything feels easy
They ought to spread this Awakening widely and redeem the people
36 / 42
72. So this is what happens
Beginners believe they must understand monad.
They can't. (Most people drop out here)
They continue to struggle to understand monad while writing codes in Haskell
At some point they do understand what monad is
Then everything feels easy
They ought to spread this Awakening widely and redeem the people
Another monad tutorial emerges
36 / 42
73. So this is what happens
Beginners believe they must understand monad.
They can't. (Most people drop out here)
They continue to struggle to understand monad while writing codes in Haskell
At some point they do understand what monad is
Then everything feels easy
They ought to spread this Awakening widely and redeem the people
Another monad tutorial emerges (there can never be enough)
36 / 42
75. Monad tutorials
A 'newbie', in Haskell, is someone who hasn't yet implemented a compiler.
They've only written a monad tutorial.
Pseudonym
37 / 42
76. Monad tutorials
A 'newbie', in Haskell, is someone who hasn't yet implemented a compiler.
They've only written a monad tutorial.
Pseudonym
Tutorial on how to write a monad tutorial
tora, My how to give a 'monad tutorial' tutorial (2010)
Travis Hance, Write you a monad tutorial (2014)
37 / 42
77. Monad is
Monad is a type class.
A type class is a set of types.
A type is a set of values.
In Haskell, monad is a shared interface to multiple types that share something in
common.
Therefore, even when a type is monadic, they may look totally unrelated to other
monadic types.
38 / 42
81. Therefore, to learn monad
First use IO type.
and Maybe type.
and List type as well.
39 / 42
82. Therefore, to learn monad
First use IO type.
and Maybe type.
and List type as well.
Write enough Haskell code. (>1k lines?)
39 / 42
83. Therefore, to learn monad
First use IO type.
and Maybe type.
and List type as well.
Write enough Haskell code. (>1k lines?)
Then all of a sudden you realize what they have in common. (Aha moment)
39 / 42
84. Therefore, to learn monad
First use IO type.
and Maybe type.
and List type as well.
Write enough Haskell code. (>1k lines?)
Then all of a sudden you realize what they have in common. (Aha moment)
It doesn't matter you still don't get it. Keep on.
39 / 42
85. Therefore, to learn monad
First use IO type.
and Maybe type.
and List type as well.
Write enough Haskell code. (>1k lines?)
Then all of a sudden you realize what they have in common. (Aha moment)
It doesn't matter you still don't get it. Keep on.
Never attempt to consciously learn what monad is.
39 / 42
86. Therefore, to learn monad
First use IO type.
and Maybe type.
and List type as well.
Write enough Haskell code. (>1k lines?)
Then all of a sudden you realize what they have in common. (Aha moment)
It doesn't matter you still don't get it. Keep on.
Never attempt to consciously learn what monad is. It would only lead to frustration
and confusion.
39 / 42
87. "Well, I did try Haskell, but that monad
thing..."
40 / 42
88. No! 😄
Don't let monad stop your adventure into Haskell!
41 / 42