template<typename A, typename B, typename C, typename D, typename E>
std::variant<std::string, std::tuple<B, C, std::vector<D>, E> processRecord(std::function_ref<B(A const&)>, std::optional<C> const&, std::span<D>, std::function_ref<bool(E const&)>, std::tuple<B, C, std::vector<D>, 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.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
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".
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.
-- Here you go
-- Oh my god, it's non-trivial