TE
TechEcho
Home24h TopNewestBestAskShowJobs
GitHubTwitter
Home

TechEcho

A tech news platform built with Next.js, providing global tech news and discussions.

GitHubTwitter

Home

HomeNewestBestAskShowJobs

Resources

HackerNews APIOriginal HackerNewsNext.js

© 2025 TechEcho. All rights reserved.

Monoids, Functors, Applicatives, and Monads: Main Ideas

94 pointsby abishekk92over 10 years ago

5 comments

DanWaterworthover 10 years ago
I&#x27;ve had an idea for a monad tutorial that I think might be quite instructive, but haven&#x27;t had the motivation yet to write.<p>In essence, the idea is that you are led through the process of implementing: early exit, nondeterminism, threaded state and coroutines using call&#x2F;cc in scheme. Then monads are introduced as a way of typing those patterns.
评论 #8838297 未加载
评论 #8838633 未加载
评论 #8837970 未加载
评论 #8838066 未加载
评论 #8843397 未加载
评论 #8838673 未加载
评论 #8838059 未加载
antoaravinthover 10 years ago
Im not getting the idea of monads here. From my understanding monads does series of transformation( composition, unit , lift ) of a function to do its task. So does monad is similar to Adapter pattern in java? which does make two classes work even though they aren&#x27;t meant to work.<p>Because it does transform the class&#x2F; interface to work with other class, right?<p>Am I missing anything here?
评论 #8841954 未加载
评论 #8839846 未加载
AnimalMuppetover 10 years ago
Monads, applicatives, functors, and monoids are different algebras. OK. That&#x27;s really helpful, actually. (At least, I suspect it&#x27;s going to be really helpful after I&#x27;ve thought about it for a few days.)<p>But monads are the way to do sequencing? Only if you insist on putting yourself in a functional straight-jacket that&#x27;s so tight that you cannot escape. Then, yes, you do sequencing via monads because you don&#x27;t have any other way to do it. But if you&#x27;re a pragmatist rather than an ideologue, it seems more reasonable to just do sequence <i>by doing things in sequence</i>, rather than forcing yourself to do unnatural contortions.
评论 #8841691 未加载
dllthomasover 10 years ago
<i>&#x27;there’s no such thing as the “IO monad” or the “List monad”&#x27;</i><p>I don&#x27;t think I agree (depending on just what is meant by &quot;such thing as&quot;)... I would say there is such thing as &quot;the IO monad&quot; in the same sense as there is such thing as &quot;the rational field&quot; or &quot;the Z&#x2F;5 group&quot;. It&#x27;s a particular example of a more general algebraic structure, and you&#x27;d use the phrase when you&#x27;re talking <i>particularly</i> about the structure as it occurs in that instance.
kinofcainover 10 years ago
Further evidence for my hypothesis that everyone who has ever understood monads has gone on to write a blog post trying to explain them.
评论 #8838940 未加载
评论 #8839667 未加载