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.

Programming Requires Breadth of Knowledge

36 pointsby ghuntleyalmost 2 years ago

1 comment

bitwizealmost 2 years ago
Once I learned how simple monads really are I found them a lot less scary, and something I could apply wherever I&#x27;m programming, not just in Haskell or another big-brain programming language. And no, not in the &quot;a monad is just a monoid in a category of endofunctors, what&#x27;s the big deal?&quot; sense.<p>Monads are a design pattern. Period. You have an object, it has at least two methods: return and bind. Using these two methods together must produce results that follow the monadic laws. Okay, now go nuts with that, because you have a <i>generalized</i> way to sequence operations expressed as combinators with controlled &quot;side effects&quot;. The monad encapsulates both the value transformations <i>and</i> the side effects. It&#x27;s a neat pattern, but just another tool in the programmer&#x27;s toolkit. Big brain come up with it, but no need big brain to <i>use</i> it. Now grug brain use monad too, trap complexity demon in crystal of monadic type.<p>I think the more we lose our fear of these cool concepts and treat them like ordinary programmers&#x27; tools, the more we might see Haskell used for grug brain stuff.<p>But really, Rust have enough big brain concepts for everyday use, close enough to Haskell without garbage collector complexity demon. Now where grug put programming socks?
评论 #36170206 未加载