TE
科技回声
首页24小时热榜最新最佳问答展示工作
GitHubTwitter
首页

科技回声

基于 Next.js 构建的科技新闻平台,提供全球科技新闻和讨论内容。

GitHubTwitter

首页

首页最新最佳问答展示工作

资源链接

HackerNews API原版 HackerNewsNext.js

© 2025 科技回声. 版权所有。

A Burrito Is a Monad

52 点作者 williamcotton8 个月前

15 条评论

joev7148 个月前
People who already know what a monad is probably think this is a great example. I still have no clue.
评论 #41699148 未加载
评论 #41699189 未加载
评论 #41699404 未加载
评论 #41699139 未加载
评论 #41699220 未加载
评论 #41699201 未加载
评论 #41699970 未加载
评论 #41700617 未加载
hrldcpr8 个月前
My Haskell is rusty—what does this line do?<p><pre><code> type Burrito = Meat option * Ingredient list </code></pre> Does `*` create a tuple type?<p>Do lowercase `option` and `list` somehow specify `Option` and `List` types?
评论 #41699253 未加载
评论 #41699228 未加载
评论 #41699273 未加载
评论 #41699278 未加载
评论 #41699249 未加载
mjd8 个月前
<a href="https:&#x2F;&#x2F;blog.plover.com&#x2F;prog&#x2F;burritos.html" rel="nofollow">https:&#x2F;&#x2F;blog.plover.com&#x2F;prog&#x2F;burritos.html</a><p>(Same concept, from 2009)
FrustratedMonky8 个月前
It&#x27;s in jest, but I find a simple example like this to be very helpful.<p>Would have gone a long way to me understanding Monads, rather than some esoteric mathematical symbols.
评论 #41699043 未加载
kelseyfrog8 个月前
This is literally, not figuratively, true.<p>There&#x27;s a lot of monads in our lives: puzzels, baking, stories, symphonies, paintings, and projects.
mcbrit8 个月前
No one who cooks, cooks like this. So, no, a burrito is not a monad, unless you are performing Catholic Mass and the burrito is sth sth, in which case you have more words to write and I while I believe you can write those words, the words are not interesting. That it why I am saying your analogy is not interesting, and I think you were just attracted to burritos because they can hold.. anything? Even though that&#x27;s not the path you went down?
评论 #41699473 未加载
radium3d8 个月前
Relegating &quot;tortilla&quot; to one word with no options is a travesty it&#x27;s the most important part of my California Burritos from Juanitas.
l5870uoo9y8 个月前
&gt; You see, in addition to space burritos (if you&#x27;ve heard the rumors), monads are like onions. Allow me to demonstrate with a common situation.<p>Another mention of monads and burritos.<p>[0]: <a href="https:&#x2F;&#x2F;mostly-adequate.gitbook.io&#x2F;mostly-adequate-guide&#x2F;ch09#mixing-metaphors" rel="nofollow">https:&#x2F;&#x2F;mostly-adequate.gitbook.io&#x2F;mostly-adequate-guide&#x2F;ch0...</a>
bckr8 个月前
The thing that has stuck with me about monads is that operations which you can chain like<p>&#x2F;&#x2F; Python<p>new_foo = foo.bar().baz()<p>Work as &#x2F; can be defined as monads, if you get a Foo out of each of them. This at least gives me something practical to hang the concept on.
fanf28 个月前
Previously: <a href="https:&#x2F;&#x2F;blog.plover.com&#x2F;prog&#x2F;burritos.html" rel="nofollow">https:&#x2F;&#x2F;blog.plover.com&#x2F;prog&#x2F;burritos.html</a>
nkrisc8 个月前
I assume that<p><pre><code> let tortilla = returnBurrito (Some Veggie, []) </code></pre> is a typo and it should be<p><pre><code> return Burrito </code></pre> ?<p>Also somewhat familiar with FP but not this specific language (guessing Haskell?), is the `&gt;==` operator essentially a &quot;pipe&quot; operator?
评论 #41699274 未加载
评论 #41699162 未加载
评论 #41699294 未加载
beefnugs8 个月前
Please do see yourself out mr, I can&#x27;t have multiple meats
bigstrat20038 个月前
Ok Haskell programmers, I love you guys but this has now gone too far and I am officially intervening. The rest of the programming community and I are all super worried about what all this Haskell is doing for your health. Please stop before it&#x27;s too late! Perhaps even touch grass, as drastic as I know that sounds.
评论 #41699172 未加载
评论 #41699485 未加载
pshirshov8 个月前
Not this shit again. How much can be said about a trivial algebraic concept with 2 laws and 3 operations?
评论 #41699199 未加载
评论 #41699444 未加载
评论 #41699239 未加载
评论 #41709082 未加载
tomerbd8 个月前
Monad is mad