The issue is less the presence of exceptions than the tendency of those exceptions to become the rule.
Therefore I would adjust TFA to point toward open loop systems, i.e. those lacking some feedback loop to keep the exceptions exceptional, as the bugaboo.
> Beginners: the onboarding experience must be our benchmark for usability
OK, so I put this into Gemini:
"show me a non-trivial haskell function and type signature with at least five distinct arguments"
And I get:
---
processRecord :: (a -> b) -> Maybe c -> [d] -> (e -> Bool) -> (b, c, [d], e) -> Either String (b, c, [d], e)
processRecord transform mVal items pred (bVal, cVal, dList, eVal)
| pred eVal = Right (transform (const bVal undefined) mVal, cVal, dList, eVal) -- simplified example logic
| otherwise = Left "Predicate failed on the fifth argument"
---
My brain just crashes after the "::".
For the beginner, there isn't enough syntax on offer to discern who's doing what to whom here.
Is there a "function signatures for dummys" somewhere?
If you read the most introductory guide of Haskell, or ask your LLM to explain, you'll find there's nothing mystifying about the syntax you quoted. You're just unfamiliar with it because you didn't do the bare minimum effort.
If I ask my grandma what she thinks of the supposedly easy Python syntax, or C-style curly braces, her brain would similarly crash. Unless she read an intro to Python or C first.
In other words, do not confuse "I'm unfamiliar with this because it doesn't resemble what I know" with "hard to understand".
I'm not part of the Haskell community. I dabbled for a while, years ago. I would have given the same answer for, say, someone complaining they cannot understand lisp syntax without first trying reading an intro article about it. "All those parentheses, what do they even mean?".
There's valid feedback in the form "after reading the free Learn You A Haskell or some chapters from Real World Haskell, I cannot figure out how to write a useful program", and then there's "I asked ChatGPT to write some code and I cannot figure out the basic syntax elements because I couldn't be bothered to read anything about the programming language first".
So you didn't read your School of Expression and "the couple other" books in your shelves, huh?
Surely you understand "the moderation" here on HN and "the Haskell community" are not the same? Over here, people are reacting to the tired old trope of "I don't understand this unfamiliar syntax that I didn't bother to learn first!".
This familiarity can be gained in frankly a day or two of trying, and afterwards you’ll find it to be clear and information dense. The example doesn’t even involve anything truly mind blowing for a beginner yet, like the Traversable class, the lens/traversal/prism signatures, or polymorphic recursion.
Similarly you can type definition (`data` keyword) your way to additional readability in Haskell. There's always a push/pull between using a generic type like `(b, c, [d], e)` and using a named type like `Record` in the above example, for instance.
Huh? How would that be a good criteria - how many languages exist where a non-user can easily grok non trivial functions with at least five distinct arguments?
If someone told me German was easy to learn, I wouldn’t get an LLM to generate me a complex sentence with two clauses and three adjectives and then be like “sure about that?”
`processRecord :: (a -> b) -> Maybe c -> [d] -> (e -> Bool) -> (b, c, [d], e) -> Either String (b, c, [d], e)`
Says:
“
give me:
1) a function of a to b,
2) a ‘c’ wrapped in a Maybe,
3) a list of d’s,
4) a function of e to a Bool,
5) a 4 tuple of a, b, list of d’s, and an e
And I will give you either a String or your original tuple back”
It doesn’t really do anything so there’s not much more to explain
> For the beginner, there isn't enough syntax on offer to discern who's doing what to whom here.
If you throw a beginner at any non-trivial code in any language without teaching them anything about the language, then, yeah, it'll be hard for them to figure it out. That says nothing about the language itself, though. That's pretty obvious to everybody.
> Is there a "function signatures for dummys" somewhere?
Yeah, of course. There's actual beginner material, here's one example:
It's the same answer I gave you, that you arbitrarily didn't like.
In this day and age, where you used an LLM to give you a random Haskell example, you cannot ask "is there an introduction...?". That's lazy and dishonest. Google it (Learn You A Haskell would have been one of the first results) or ask the same LLM you used for your contrived example:
https://chatgpt.com/share/6af86ef7-fa4c-83e9-b32f-7daeb7753d...
It's not tough love, it's that you're being dishonest.
I use it mostly as a personal StackOverflow. I describe my issue as best as I can and get answers/suggestions, sometimes a code snippet that I check and paste over, but often still writing my own code or rewriting the snippet so much that it's as if I wrote it in the first place.
The friction makes it much slower than agentic coding but it helps me stay in control and it's still faster than before.
And if the sentiment toward such sleight of hand is as negative as the sentiment toward Trump last Tuesday, then the pendulum could swing as swiftly to the right as it did to the left.
This was pretty clearly a backlash against the high gas and groceries prices. Oh and data centers. The average voter doesn't care about things they think are too complicated.
What grieves me is that, if I don't fancy these fancy fobs, and want an old-school key with a traditional ignition, our purportedly capitalist system doesn't quite have the marketplace to support me.
This is also true for a manual transmission and no-chip design. I basically want a freshly manufactured old-school Jeep.
Honestly I think if someone restarted production of the Jeep XJ as it was towards the end of its run they would probably outsell almost everything you could buy today.
You could restart it, but it would not be as profitable as whatever they're doing now and it would eat into the market share of the rest of jeep's lineup. Even if you made a competitor, you're competing with a product that has better margins than you and more access to capital. It's competitive in terms of consumer demand, not in aggregate profit.
Company A netting $1 from 50 happy customers is nowhere near as profitiable as Company B netting $10 from 10 miserable customers. Consider that Company A and B also compete for capital and manufacturing capability and such, not just customers. The market has chosen Company B as the most efficient vehicle to extract wealth from customers.
In fact the more Company B (and companies like it) succeed, the more capital they collectively soak up and the fewer competitors they'll have. The less leverage these miserable customers will have.
It's like the market-driven spread of some technology, like shipping containers. Except instead of a cost-cutting technology it's a price-inflating technology. Like movie theaters choosing to add massive markups to their snack bar. If you're a movie theater and you don't extort your customers for snacks, you have to raise ticket prices or lower profitability and you can't make ends meet or be as capital efficient as competitors.
I think there is some solution to this that isn't just heavy-handed regulation that companies will shoot loopholes in and run laps around. Maybe some type of stakeholder capitalism where consumers have more power than shareholders. Crowdsupply is one such example.
If less people need to work while there is enough money to go around. What makes them freeloaders? Do you think children are freeloaders? What about retirees or veterans or disabled people?
"No plan of operations extends with any certainty beyond the first contact with the main hostile force."--Prussian Field Marshal Helmuth von Moltke the Elder
Therefore I would adjust TFA to point toward open loop systems, i.e. those lacking some feedback loop to keep the exceptions exceptional, as the bugaboo.
reply