this post was submitted on 11 Sep 2025
40 points (100.0% liked)

Programming

22768 readers
40 users here now

Welcome to the main community in programming.dev! Feel free to post anything relating to programming here!

Cross posting is strongly encouraged in the instance. If you feel your post or another person's post makes sense in another community cross post into it.

Hope you enjoy the instance!

Rules

Rules

  • Follow the programming.dev instance rules
  • Keep content related to programming in some way
  • If you're posting long videos try to add in some form of tldr for those who don't want to watch videos

Wormhole

Follow the wormhole through a path of communities !webdev@programming.dev



founded 2 years ago
MODERATORS
 

Specifically, I'm interested in BEAM, but I'm not sure if I should go for Elixir or Gleam. What seems cool about Gleam is that it has static typing.

I have no experience with functional programming at all btw

you are viewing a single comment's thread
view the rest of the comments
[–] NostraDavid@programming.dev 21 points 1 week ago (3 children)

Haskell:

https://learnyouahaskell.com/introduction

It's been a while since writing some (2018), but the concepts you learn from Haskell are great (though I still can't explain Monads, even if my life depended on it) and can be applied in other languages.

Anyway, I can't speak to BEAM, but Haskell is very typeful, it teaches you currying, very great language, awful tooling (but that was ~10 years ago, so I hope things have improved since).

[–] Kache@lemmy.zip 8 points 1 week ago (2 children)

In practical terms, "monad" means "chainable".

[–] azolus@slrpnk.net 3 points 1 week ago

And I thought it was about morphisms and burritos. The more you know...

[–] Sxan@piefed.zip 1 points 1 week ago
[–] Corbin@programming.dev 2 points 1 week ago

Haskell isn't the best venue for learning currying, monads, or other category-theoretic concepts because Hask is not a category. Additionally, the community carries lots of incorrect and harmful memes. OCaml is a better choice; its types don't yield a category, but ML-style modules certainly do!

@thingsiplay@beehaw.org and @Kache@lemmy.zip are oversimplifying; a monad is a kind of algebra carried by some endofunctor. All endofunctors are chainable and have return values; what distinguishes a monad is a particular signature along with some algebraic laws that allow for refactoring inside of monad operations. Languages like Haskell don't have algebraic laws; for a Haskell-like example of such laws, check out 1lab's Cat.Diagram.Monad in Agda.

[–] thingsiplay@beehaw.org 2 points 1 week ago (1 children)

When I read about Monads, it looks like to me like generic Rust struct with a generic trait and a (more complex) result as a return value. I have no idea if this is what a Monad basically is or not. For context, I never learned Haskell properly (just tried hello world and read a few topics).

[–] bitcrafter@programming.dev 6 points 1 week ago (1 children)

You should think of Monad as basically giving you a way to provide your own implementation of the semicolon operator so that you can dictate what it means to sequence computations of a given type.

[–] thingsiplay@beehaw.org 3 points 1 week ago

I think the mistake I do (and many others) is trying to compare existing mechanisms from other languages, without the full picture around that mechanic. Every time I think to understand what a Monad is, its wrong. :D Guess I have to dive deeper to understand what that actually means, not just as an explanation. Just out of curiosity.