486
you are viewing a single comment's thread
view the rest of the comments
[-] PoolloverNathan@programming.dev 6 points 6 months ago

Haskell's crazy operation is intuitive though. Assuming you're talking about >>=, it's just a generalized flatMap.

[-] baseless_discourse@mander.xyz 1 points 6 months ago* (last edited 6 months ago)

This is probably a rather controversial topic in the haskell community. Haskell library and base has a tendency to provide “too many“ infix operator (at least IMO), many of which makes code hard to read for beginners and experts alike.

See the discussion here: https://wiki.haskell.org/Haskell_programming_tips/Discussion#Use_syntactic_sugar_wisely

[-] expr@programming.dev 2 points 6 months ago

As a professional Haskell developer, I tend to agree. I loathe any and all lens code I find using a ton of operators (though I just dislike lenses in general). Operators from base are generally fine, but for the rest, just use normal functions damnit. Operators suck for code navigation too.

[-] baseless_discourse@mander.xyz 1 points 6 months ago

Yeah, it is one of the problem I have about Haskell.

The other two are lazy evaluation makes print debugging almost impossible, you will need to print the entire environment to figure out where you are.

Finally, I feel like List.fold, state monad, lens are basically just working with mutable structure with extra steps. Although this constructs prevent newbies who are not principled enough to effectively use mutable structure from using mutable structure, but it also doesn't help experienced user to write more effective and clean code.

Mutuabilty are certainly not harmless either. For example in ocaml, if you construct the IntSet type twice, they will be two completely different type. But this behavior can be pretty easily avoided by an experienced user.

What do you feel about these features/shortcomings?

this post was submitted on 07 Mar 2024
486 points (99.2% liked)

Programmer Humor

19138 readers
649 users here now

Welcome to Programmer Humor!

This is a place where you can post jokes, memes, humor, etc. related to programming!

For sharing awful code theres also Programming Horror.

Rules

founded 1 year ago
MODERATORS