# Difference between revisions of "IO then abstraction"

(Content relocated from "Output/Input") |
m |
||

(4 intermediate revisions by the same user not shown) | |||

Line 1: | Line 1: | ||

− | |||

<div style="border-left:1px solid lightgray; padding: 1em" alt="blockquote"> | <div style="border-left:1px solid lightgray; padding: 1em" alt="blockquote"> | ||

Still, today, over 25 years after the introduction of the concept of monads to the world of functional programming, beginning functional programmers struggle to grasp the concept of monads. This struggle is exemplified by the numerous blog posts about the effort of trying to learn about monads. From our own experience we notice that even at university level, bachelor level students often struggle to comprehend monads and consistently score poorly on monad-related exam questions. | Still, today, over 25 years after the introduction of the concept of monads to the world of functional programming, beginning functional programmers struggle to grasp the concept of monads. This struggle is exemplified by the numerous blog posts about the effort of trying to learn about monads. From our own experience we notice that even at university level, bachelor level students often struggle to comprehend monads and consistently score poorly on monad-related exam questions. | ||

Line 6: | Line 5: | ||

<tt>[https://pms.cs.ru.nl/iris-diglib/src/getContent.php?id=2017-Steenvoorden-SupportLearning Visual Support for Learning Monads], Tim Steenvoorden, Jurriën Stutterheim, Erik Barendsen and Rinus Plasmeijer.</tt> | <tt>[https://pms.cs.ru.nl/iris-diglib/src/getContent.php?id=2017-Steenvoorden-SupportLearning Visual Support for Learning Monads], Tim Steenvoorden, Jurriën Stutterheim, Erik Barendsen and Rinus Plasmeijer.</tt> | ||

+ | </div> | ||

+ | <span> </span> | ||

+ | <div style="border-left:1px solid lightgray; padding: 1em" alt="blockquote"> | ||

+ | If you put up a video about monads, the comments are fantastic [...] my personal favourite: | ||

+ | * ''What is a Monad? A miserable pile of functions.'' | ||

+ | |||

+ | <tt>[https://twitter.com/haskellhutt/status/1192039007716364288 Graham Hutton].</tt> | ||

</div> | </div> | ||

− | ...so where are students of Haskell most likely to have their first encounter with this irksome interface? | + | ...so where are students of Haskell most likely to have their first encounter with this irksome interface? |

+ | <div style="border-left:1px solid lightgray; padding: 1em" alt="blockquote"> | ||

+ | Haskell, for some the digital equivalent of a 'garden of eden'-esque waterfall under a beautiful sunset; for others a source of pain and stress. This pain and stress is for beginners often largest when they have learned a little bit about monads like <code>IO</code>. | ||

+ | |||

+ | <tt>[https://hugopeters.me/posts/13/ Hugo Peters].</tt> | ||

+ | </div> | ||

+ | <span> </span> | ||

<div style="border-left:1px solid lightgray; padding: 1em" alt="blockquote"> | <div style="border-left:1px solid lightgray; padding: 1em" alt="blockquote"> | ||

<code>IO</code> is the monad you cannot avoid. | <code>IO</code> is the monad you cannot avoid. | ||

− | <tt>[https://image.slidesharecdn.com/functionalconf2019-whyishaskellsohard2-191116135003/95/why-is-haskell-so-hard-and-how-to-deal-with-it-53-638.jpg | + | <tt>[https://image.slidesharecdn.com/functionalconf2019-whyishaskellsohard2-191116135003/95/why-is-haskell-so-hard-and-how-to-deal-with-it-53-638.jpg Saurabh Nanda].</tt> |

</div> | </div> | ||

If bachelor-level students are often struggling to comprehend the monadic interface, then it has ''no place whatsoever'' in any introductory Haskell course! I/O in Haskell must therefore be totally independent of the monadic interface. The introduction of this interface, including its basic operations, should be deferred to an advanced course of study where it can join functors, applicatives, arrows and maybe even category theory itself: only then should students be introduced to monadic I/O. | If bachelor-level students are often struggling to comprehend the monadic interface, then it has ''no place whatsoever'' in any introductory Haskell course! I/O in Haskell must therefore be totally independent of the monadic interface. The introduction of this interface, including its basic operations, should be deferred to an advanced course of study where it can join functors, applicatives, arrows and maybe even category theory itself: only then should students be introduced to monadic I/O. | ||

+ | |||

+ | <div style="border-left:1px solid lightgray; padding: 1em" alt="blockquote"> | ||

+ | The most difficult construct for students to understand is the monad. I introduce <code>IO</code> without mentioning monads. | ||

+ | |||

+ | <tt>[[Haskell in education|Olaf Chitil]].</tt> | ||

+ | </div> | ||

A [https://www.interaction-design.org/literature/article/kiss-keep-it-simple-stupid-a-design-principle simple] general-purpose model of I/O for non-strict functional languages remains an [[Open research problems|open research problem]]... | A [https://www.interaction-design.org/literature/article/kiss-keep-it-simple-stupid-a-design-principle simple] general-purpose model of I/O for non-strict functional languages remains an [[Open research problems|open research problem]]... | ||

[[Category:Rants and comments]] | [[Category:Rants and comments]] |

## Latest revision as of 06:27, 31 March 2022

Still, today, over 25 years after the introduction of the concept of monads to the world of functional programming, beginning functional programmers struggle to grasp the concept of monads. This struggle is exemplified by the numerous blog posts about the effort of trying to learn about monads. From our own experience we notice that even at university level, bachelor level students often struggle to comprehend monads and consistently score poorly on monad-related exam questions.

Considering that the concept of monads is not likely to disappear from the functional programming landscape any time soon, it is vital that we, as the functional programming community, somehow overcome the problems novices encounter when first studying monads.

`Visual Support for Learning Monads, Tim Steenvoorden, Jurriën Stutterheim, Erik Barendsen and Rinus Plasmeijer.`

If you put up a video about monads, the comments are fantastic [...] my personal favourite:

*What is a Monad? A miserable pile of functions.*

...so where are students of Haskell most likely to have their first encounter with this irksome interface?

Haskell, for some the digital equivalent of a 'garden of eden'-esque waterfall under a beautiful sunset; for others a source of pain and stress. This pain and stress is for beginners often largest when they have learned a little bit about monads like `IO`

.

`IO`

is the monad you cannot avoid.

If bachelor-level students are often struggling to comprehend the monadic interface, then it has *no place whatsoever* in any introductory Haskell course! I/O in Haskell must therefore be totally independent of the monadic interface. The introduction of this interface, including its basic operations, should be deferred to an advanced course of study where it can join functors, applicatives, arrows and maybe even category theory itself: only then should students be introduced to monadic I/O.

The most difficult construct for students to understand is the monad. I introduce `IO`

without mentioning monads.

A simple general-purpose model of I/O for non-strict functional languages remains an open research problem...