frontpage.
newsnewestaskshowjobs

Made with ♥ by @iamnishanth

Open Source @Github

fp.

Open in hackernews

Ask HN: Does anyone know what a monad is?

3•etrvic•1h ago
I’ve started learning haskell a few weeks ago and I’ve been recently trying to understand what a monad is. I can’t seem to find and explanation that makes sense. Every other comment on the subject seems to be about how no one can explain what is a monad.

For example I don’t understand (beyond the concept as a whole): 1. How do monads allow side effects if you can’t have side effects in Haskell? 2. Are monads just a name for a reccuring way to aproach a problem? 3. In what scenario would you use a monad, or for what type of problem?

Comments

WarOnPrivacy•46m ago
Kagi says: A monad is a concept that appears across multiple domains—philosophy, functional programming, spirituality, and cosmology—with different interpretations in each context.
TacticalCoder•35m ago
Not a burrito?
floxy•23m ago
The time-honored way of learning about monads is to write a monad tutorial. Monads provide an order dependency (that along with some hidden strictness for I/O and the like) which allows the side-effecting to be isolated from the "pure" functional side of things. The purely functional Clean language had an explicit "world" variable that you could pass around to whatever side-effecting functions you wanted. And it had uniqueness typing so that you couldn't accidentally refer to the same "world" twice. You can think about monads as being a way to hide the crufty "world". A lot of the mystery around monads comes simultaneously with a whole bunch of other newness in learning Haskell (lazy evaluation, HM type system, differing syntax, algebraic data types, currying and partial application, functional programming, etc.).

https://en.wikipedia.org/wiki/Clean_(programming_language)

rowbin•11m ago
I'm not a Haskell expert, but I dabbled quite a bit. This is my explanation of what monads are that doesnt rely on math lingo and understanding the maths behind it. I don't fully understand myself but maybe thats actually helpful for trying to explain to someone not familiar with the concept. My understanding relies on concepts used in other programming languages. So depending on how familiar you are with them, this might or might not be helpful for you.

A monad is kind of like a generic class to boxes that adds additional logic to the data it boxes without actually caring about the data itself.

My goto monad for that concept is a linked list and the map operator. So an instance of the linked list might be Node(5) -> Node(7) -> EmptyList. Now let's call map with a function f(x) = str(x) + " * 2 = " + str(2x). This gives us Node("5 2 = 10") -> Node("7 * 2 = 14") -> EmptyList.

Now let's separate the monad from this. The monad is the structure and logic around the data and the function that we provide. The monad doesn't care what data it holds and is doesn't care what function we provide. It only defines the structure and how functions are applied to the data it holds.

AI Cannot Self Improve and Math Behind Proves It!

https://smsk.dev/2026/04/26/ai-cannot-self-improve-and-math-behind-proves-it/
1•mdwrigh2•35s ago•0 comments

Show HN: Clodcapture – save and resume Claude.ai chats across sessions

https://chromewebstore.google.com/detail/clodcapture/mhapejnhlmepeinjmlppoopcoicmgojb
1•leo_agent•1m ago•0 comments

Cherry Kearton: The eccentric influence on a young Sir David Attenborough

https://www.bbc.com/future/article/20260507-cherry-kearton-the-eccentric-influence-on-a-young-sir...
1•breve•4m ago•0 comments

Two more public disclosures, it will never stop

https://deadeclipse666.blogspot.com/2026/05/two-more-public-disclosures-it-will.html
1•Animux•4m ago•0 comments

Fuck You, Bambu Lab. Go Ahead, Sue Us

https://gamersnexus.net/fk-you-bambu-lab
2•pabs3•8m ago•0 comments

Anything that is underneath the cursor gets fed into Google's surveillance AI

https://mastodon.social/@mcc/116563821063587689
3•doener•10m ago•0 comments

RealtimePokerCalculator

https://www.mik.lt/RealtimePokerCalculator.zip
1•reztart•11m ago•0 comments

The Walled Garden of the Surveilled Web

https://kirill.korins.ky/articles/the-walled-garden-of-the-surveilled-web/
1•catap•11m ago•0 comments

Snack giant switches to black and white packaging as Iran war hits ink supplies

https://www.bbc.com/news/articles/c78k405j8pdo
1•breve•11m ago•0 comments

Show HN: Dexgram – Telegram to Codex Desktop Bridge for Windows

https://github.com/yashau/dexgram
1•yashau•13m ago•0 comments

Not so dusty: How tech is changing woodworking

https://www.bbc.com/news/articles/c747n11933eo
1•breve•14m ago•0 comments

Waymo recalls U.S. robotaxi fleet after vehicle swept away in flood

https://www.expressnews.com/business/article/waymo-recall-san-antonio-flood-22254607.php
1•zzzeek•15m ago•1 comments

OpenAI Trial – Greg Brockman's Journal

https://www.wsj.com/tech/musk-openai-trial-greg-brockman-diary-journal-6950270e
1•ilarum•18m ago•0 comments

Could At-Home Brain Stimulation Reduce Psychiatry's Reliance on S.S.R.I.s?

https://www.nytimes.com/2026/04/28/health/depression-at-home-brain-stimulation-fda.html
2•bookofjoe•18m ago•1 comments

Open source rule based guardrails for coding agents

https://github.com/falcosecurity/prempti/tree/main
1•knoxa2511•19m ago•0 comments

America is experiencing a productivity miracle

https://www.economist.com/finance-and-economics/2026/05/11/america-is-experiencing-a-productivity...
1•mackmcconnell•26m ago•0 comments

Turritopsis Dohrnii

https://en.wikipedia.org/wiki/Turritopsis_dohrnii
1•thelastgallon•27m ago•0 comments

Loading/running every LLM with 4M ctx in 3 clicks

https://old.reddit.com/r/Hugston/comments/1tbgrbb/4_million_ctx_for_every_ai_llm_model/
1•trilogic•28m ago•0 comments

DuckDB Quack Announcement [video]

https://www.youtube.com/watch?v=RQBhuL9Ve8g
1•fredguth•31m ago•0 comments

The Unmet Needs Index

https://www.convoke.bio/blog/introducing-the-unmet-needs-index
3•ray__•34m ago•0 comments

How AI Is Making Us All Dumber [video]

https://www.youtube.com/watch?v=eSABedBwZjQ
2•mooreds•35m ago•0 comments

All the demons hiding in your AIs

https://drtompollak.substack.com/p/all-the-demons-hiding-in-your-ais
1•gmays•35m ago•0 comments

Companies start getting tariff refunds after Supreme Court decision

https://www.cnbc.com/2026/05/12/trump-tariff-refunds.html
2•tcp_handshaker•36m ago•0 comments

Apple will soon start using AI-generated presenters on its Sales Coach app

https://9to5mac.com/2026/05/12/apple-will-soon-start-using-ai-generated-presenters-on-its-sales-c...
1•cdrnsf•37m ago•0 comments

Twin brothers wipe 96 government databases minutes after being fired

https://arstechnica.com/tech-policy/2026/05/drop-database-what-not-to-do-after-losing-an-it-job/
4•jnord•37m ago•1 comments

The revolt against I-Ready: Private equity-backed education software faces fury

https://www.nbcnews.com/news/education/iready-school-software-faces-parent-teacher-student-fury-r...
1•Umofomia•38m ago•0 comments

I Bought a "Junk" PSP from Japan: Here's How It Went

https://gardinerbryant.com/i-bought-a-junk-psp-from-japan-heres-how-it-went/
1•Kate0CoolLibby•38m ago•0 comments

Subvert: The music platform owned by its community

https://www.subvert.fm/
1•vectordust•39m ago•0 comments

Preview bill is now available

https://copilot-billing-preview.github.com/
1•predkambrij•42m ago•0 comments

Empathy as Principal Computation Substrate

1•mimoos•48m ago•0 comments