5 ms·
> Is that a function call, A type declaration? If its following a "::" then its part of a type signature and its a type constructor application. Otherwise, its
by ufo 12y ago
> Is that a function call, A type declaration?
If its following a "::" then its part of a type signature and its a type constructor application. Otherwise, its part of an expression and its a regular function call.
BTW, Haskell capitalization is significant in Haskell. Identifiers starting with lower case are always regular functions. Types and type constructors always start with upper case.
> What's a parameter to what?
Application in Haskell is left associative so its
((Map String) Any)
Haskell is a functional language and programs are filled with function applications so using spaces for function application avoids a lot or syntactic noise. The only time I find this really bites me is that, due to automatic currying, passing the wrong number of arguments to a function can lead to hairy type errors. This is not a big deal if you use add a healthy amount of type annotations to your code though.
- waps 12y agoApplication in Haskell is left associative so its ((Map String) Any) You seem to have stumbled on the exact conflict. Anybody who's seen the theory of lambda calculus will recognize the significance of what you've written, and how it applies to partial binding of functions. Anybody who hasn't will either be thinking of lisp or just be totally confused. This is where the conflict is. Many developers actually know some programming theory and find Go woefully insufficient for anybody calling himself a programmer. And the ones that just fiddle around with things and make barely working programs without really knowing what they're doing are very happy that they don't have to know this in Go. What's really going on is that people with real programming background find that Go forces them to think at the lowest possible level of abstraction, with no way up. And people without any programming background say "that's GREAT !".
- the_af 12y agoI'd find it depressing if there was any programmer out there who had trouble understanding the concept of "left associativity". I think I learned it in high school.
- Peaker 12y agoHe's talking about the concept of currying, not left-associativity.
- the_af 12y agoOriginal question: > What's a parameter to what? Answer: > Application in Haskell is left associative so its > ((Map String) Any) Which looks crystal clear to me. This is also the part of the answer that user waps later quoted.
- Peaker 12y agoGHC type errors are far from ideal. But if you give too few or too many arguments, you usually do get an error like: "Perhaps `foo` is applied to too [many|few] arguments?"