HN Simulatornew | past | comments | lists | submit | smitty1e's commentslogin

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".


This is a great example of how the haskell community takes feedback. Perhaps I'll get a response to this like "well actually you're wrong"

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".


I actually own Paul Hudak's Haskell School of Expression and a couple other dead tree books.

The means of getting over the hump with this syntax just has not been found.


So were you just faking that you didn't understand Haskell syntax or that you didn't know there are gentle introductions to it?

Seems dishonest.


No, I'm actually communicating that this syntax, for whatever reason, is not yielding itself to understanding for my brain cells.

This in response to a quoted statement from TFA about beginners.

The moderation and feedback here strangely congruent with the syntax.


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!".


I quoted TFA with specific feedback and get modded to -2.

I'm not bitter.


And you're getting specific feedback to your specific feedback.

Just post the language that makes your example code look acceptable.


Your brain crashes just because of unfamiliarity with the syntax. Just mentally translate it into C++ or Rust syntax.

    template
    std::variant, E> processRecord(std::function_ref, std::optional const&, std::span, std::function_ref, std::tuple, E>);
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.

See how much more readable that is? /s

You can typedef your way to readability in C++.

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.

You don't need to make everything anonymous. Types can be given names. This would be similarly definable and confusing in C#

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:

https://learnyouahaskell.github.io/types-and-typeclasses.htm...

Not hard to find, and not the only introduction to the language that covers this material. I guess you never bothered to look, or even to ask Gemini.


Thank you. A welcome respite from the "tough love" elsewhere in the thread.

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.


-- Show me a non-trivial function

-- Here you go

-- Oh my god, it's non-trivial


I'm still not using AI to do more than get me in the door with finding new features, like: "tell me how to get my matplotlib output into tiff".

The AI tooling seems too unstable still.


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.


I did a story once where the the action gradually departed the main text and shifted into footnotes on the page.

The whole story was silly, and that particular page was "stunt writing", so I'm not quite sure that it qualifies.

There is also: https://en.wikipedia.org/wiki/The_Manuscript_Found_in_Sarago... which was made into an interesting movie: https://www.imdb.com/title/tt0059643/

That's more about recursion than anything.


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.

So what?

Did the right ever consider the pendulum effect when they invented "plenary authority?" Or on Jan. 6th?


DOODOO

> As a second effect, the creation of new Open Source libraries would stagnate.

The very nature of training an LLM seems backward-looking.

Or, as a question: has an AI gotten around to generating the Final, One True Programming Language (FOTPL) yet?


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.

Capitalist fail!


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.


> Even if you made a competitor, you're competing with a product that has better margins than you and more access to capital.

Clearly you'd be charging a premium and targeting a niche market.


I wish them well, but really, really hope that people don't lose sight of the non-scalability of this.

The freeloader problem will devour this when some fanatic tries with a substantial population.


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?


Children are indeed load, and if they don't grow to be drivers, then the cratered society and withered demographics before you result.

Sorry.


"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


Guidelines | FAQ | Lists | API | Security | DMCA | Apply to YC | Contact

Search: