News for hackers. Stuff that matters.
Re:Standardized Ladder of Functional Programming [pdf] by andolanra on Tuesday November 29, 2016 @11:17PM (#13068459)
Some complaints about this list:

1. This list is very Haskell-focused: it includes lots of features which only make sense in Haskell or very Haskell-like languages, and lacks mention of many interesting functional programming concepts which don't appear in Haskell (like ML-style modules and functors, row types, macro systems and homoiconicity, and so forth.) There are a lot of functional languages which have very different ideas about how to program, and this list doesn't reflect that.

2. Some of the 'skill hierarchy' choices feel a bit confused and arbitrary. For example, 'Use lenses & prisms to manipulate data' appears as a Competent skill, but 'Use optics to manipulate state' appears as a Proficient skill, despite being slightly different ways to refer to an effectively identical skill. (I assume the latter means "…use lenses & prisms to manipulate data, but in a state monad," which is only a tiny difference.)

3. While I like the idea of a list of a road-map to learning, I feel like this gives the unfortunate impression that many of these are obligatory skills. It calls itself a "standard" hierarchy (which makes it sound like a consensus, rather than just a single person/group's opinion) and has language like "…skills that developers must master on their journey…" (emphasis mine), but the list includes a lot of things that are far from necessary for deeply understanding functional programming. You could lead a long (academic or industry) career in functional programming without a deep understanding of many concepts listed: things like comonads, recursion schemes, finally tagless interpreters, higher-order abstract syntax, and so forth. All of them are useful concepts and deserve study, but you can definitely be a functional programming expert without ever having seen a comonad.

In many ways, I wish this list took a cue from Benjamin Pierce's Types and Programming Languages which features not an ordered list but a graph of the concepts related in the book, and how they relate to other concepts. It would be more complicated, true, but also a lot more honest about the academic and intellectual path you might want to take through functional programming, and without giving the idea that you need to master the vagaries of dozens of Oleg Kiselyov's papers just to be "competent" in functional programming.

Re:Standardized Ladder of Functional Programming [pdf] by jarcane on Wednesday November 30, 2016 @03:23AM (#13069249)
This is ... much more politely and detailedly stated than I managed on Twitter.

I work in FP, programming Clojure for real-world web applications every single day, and 90% of this list is completely meaningless to me.

It's nothing less than more of the Haskellite strain of "everything must be hideously complicated type theory or it's not 'real' FP."

And that shit can fuck right off. It's incredibly hostile and disrespectful both to new programmers and existing ones. It's even harmful to Haskell itself as a language, because this persistent attitude that you have to learn advanced type theory just to get anything done in Haskell is one of the biggest barriers to adoption and learning of the language, especially when even most of the material supposedly for "beginners" insists on thrusting this attitude on the reader.

Once again, just as they did by platforming an open fascist, LC demonstrates a complete cluelessness both of the community it claims to represent, and of the impact their "representation" has on said community.

Re:Standardized Ladder of Functional Programming [pdf] by pka on Wednesday November 30, 2016 @06:56AM (#13069996)
The fact that it's meaningless to you doesn't mean it doesn't have any meaning :)

Your "hideously complicated type theory" is many peoples' "hideously horrible paren-based syntax" - i.e. Lisp. So, how many people don't learn Lisp only because of its syntax? I'd say a lot.

Many of the concepts make sense when having an explicit type system, so if you want types you may want to learn them.

Others I suspect you are already using, even if you don't know them by name. Have you ever used streams? Congratulations, this is what codata is.

Re:Standardized Ladder of Functional Programming [pdf] by AimHere on Wednesday November 30, 2016 @09:38AM (#13071042)
> "hideously horrible paren-based syntax" - i.e. Lisp. So, how many people don't learn Lisp only because of its syntax? I'd say a lot.

But the point is that nobody's putting 'S-expression syntax languages' in a Lisp-centric list of essential functional programming skills. The idea that half this stuff is supposedly mandatory is a skewed perspective.

> Others I suspect you are already using, even if you don't know them by name.

And if the list is comprised of Haskell-centric jargon for more generic notions, that's obviously grounds for criticism.

Re:Standardized Ladder of Functional Programming [pdf] by pka on Wednesday November 30, 2016 @10:50AM (#13071659)
> But the point is that nobody's putting 'S-expression syntax languages' in a Lisp-centric list of essential functional programming skills.

They should've probably said "FP-only" (i.e. pure) languages to exclude imperative languages that merely support functional programming constructs, like Clojure, Erlang, etc.

I agree, many of the concepts that are useful in pure languages (i.e. monads) are not that practical in imperative/impure or dynamic languages (at the cost of reduced ability to reason about your program.)

> And if the list is comprised of Haskell-centric jargon for more generic notions, that's obviously grounds for criticism.

It's the other way around - the items on this list are the more generic concepts [0]. Less expressive languages lack the (practical) ability to reason about those concepts generically, hence the need for more specialized constructs, like i.e. streams, transducers, etc.

[0] https://en.wikipedia.org/wiki/Coinduction#Codata

Re:Standardized Ladder of Functional Programming [pdf] by jarcane on Wednesday November 30, 2016 @11:19AM (#13071942)
They should've probably said "FP-only" (i.e. pure) languages to exclude imperative languages that merely support functional programming constructs, like Clojure, Erlang, etc.

Ahh, and there would be that definition again, the one at the root of the problem.

Please find your nearest whiteboard and write the following 100 times or until it sinks in: "Haskell is not the only Functional Programming language."

FFS, the languages that invented functional programming are not Haskell, and predate it by some time. Lisp dates back to 1958. Scheme first appeared in 1970. ML dates to 1973. Haskell didn't even exist until 1990.

This weird ahistorical definition of "functional programming" is both useless and inaccurate. Strict typing and purity are not the sole measure of whether a programming language is functional and never have been. It's only been in the last few years that there seems to be this desperate push to define FP as "Haskell", which as far as I can tell is the product more of a desperate kind of evangelism than any sound argument for such a limited definition.

We get it, you like Haskell. But some of us also like Clojure, and Erlang, and Elixir, and F#, and OCaml, etc. etc., and you don't get to just redefine terms to cut out languages you don't like. Reality doesn't work that way.

Re:Standardized Ladder of Functional Programming [pdf] by willtim on Wednesday November 30, 2016 @01:13PM (#13073105)
But Haskell does stand out among your list as being a pure functional programming language (it is not the only example of course). Whether this is a good or bad thing, I will not get into. When programming in a pure language you typically have to use some quite recent/advanced ideas such as monads and lenses, just to get practical work done. This is not the case with Clojure, F#, Scala, Erlang etc, where side-effects are idiomatic. In fact, if you tried to go fully pure with these languages, you would run into problems with performance.

To avoid confusion, they should have used the term "pure functional programming" or even "typed pure functional programming".

Re:Standardized Ladder of Functional Programming [pdf] by jarcane on Wednesday November 30, 2016 @02:01PM (#13073588)
To avoid confusion, they should have used the term "pure functional programming" or even "typed pure functional programming".

That's what was used when I started learning FP, which was maybe three or four years ago. There was FP, and then purity was a secondary characteristic. Haskell was pure and typed, but that didn't make other languages not FP, when they still had all the same basic tools and the same idiomatic focus on composition of functions over mutable state and imperative logic. No, you didn't need a special magic word to allow you to have side-effects like I/O, and most also allowed for mutability (even Scheme had set! after all), but they are first and foremost functional languages. In many ways, Haskell was and still kind of is the odd one out, not counting experiemental academic languages like Idris and Coq.

This wasn't even a controversial statement just a few years ago. But as Haskell has been more and more in vogue, there's this weird fixation on redefining the window of what "FP" is to only refer to, well, Haskell. And it's very clearly what the LC list is all about, because so many of the concepts described are both largely unique to Haskell and it's closest relatives, and unnecessary to do practical, everyday work in a vast majority of FP languages.

And ultimately, attitudes like that hurt the whole field. In trying to fix Haskell's image problem by brute force, they wind up damning the larger domain in the process.

Re:Standardized Ladder of Functional Programming [pdf] by pka on Wednesday November 30, 2016 @04:37PM (#13074926)
If your language is not purely functional it is imperative. There is really no conceptual difference between Clojure and Python, except for syntax/macros and that Clojure has immutable data structures in clojure.core.

You could use mutable arrays in Clojure the same way you could use immutable arrays in Python (yet nobody is calling Python a functional language.)

Still, I agree that functional mostly means "language with closures and immutable data" in the mainstream, but in the context of this post I'd say it's not that hard to guess that the authors meant purely functional.

Re:Standardized Ladder of Functional Programming [pdf] by Sean1708 on Wednesday November 30, 2016 @09:38AM (#13071046)
I think the point was that this is a Standardized Ladder of Haskell Programming masquerading as a Standardized Ladder of Functional Programming.
Re:Standardized Ladder of Functional Programming [pdf] by seanparsons on Wednesday November 30, 2016 @08:48AM (#13070590)
I really don't understand your rage about this, you could offer up constructive criticism and suggest an alternative that more closely suits Clojure/Lisp development.

The strain you're referring seems like this perception that is somehow self perpetuating. My experience is that of an incredibly helpful community that gives up its time to help and educate people.

Re:Standardized Ladder of Functional Programming [pdf] by sclv on Wednesday November 30, 2016 @07:24PM (#13075940)
I think this list is not reflective of a general Haskell outlook. Its reflective of an outlook of people standing _outside_ Haskell (LC is historically a scala-heavy conference) and projecting onto it a certain sort of structure of expectations that isn't actually how Haskellers in general view things. I agree that this misperception isn't a good thing for Haskell -- but its a misperception imposed from the _outside_.
Re:Standardized Ladder of Functional Programming [pdf] by willtim on Wednesday November 30, 2016 @01:26PM (#13073240)
> And that shit can fuck right off

This is Anti-intellectualism.

FP is often a sliding scale. You can program with as much or as little type safety, purity or totality as you want. Some folks like to push the boundaries of what is possible without shortcuts, taking inspiration from recent research. Many Haskell, OCaml, Scala and F# libraries will require some of the concepts in this list to understand. I do agree that the list is somewhat Haskell centric though.

Re:Standardized Ladder of Functional Programming [pdf] by Veen on Wednesday November 30, 2016 @04:10AM (#13069407)
Was with you all the way to the end, where you chose to insert a bit of entirely irrelevant politicking.
Re:Standardized Ladder of Functional Programming [pdf] by pron on Wednesday November 30, 2016 @07:19AM (#13070097)
I think that Haskell's takeover of the term "functional programming" in certain circles/contexts is both inevitable and nothing you should care about (I, too, program in Clojure, an imperative-functional language, and I don't mind it not being perceived as "true FP"). See this relevant discussion: https://www.reddit.com/r/programming/comments/59hubc/happine...
Re:Standardized Ladder of Functional Programming [pdf] by bjz_ on Wednesday November 30, 2016 @03:02AM (#13069182)
> In many ways, I wish this list took a cue from Benjamin Pierce's Types and Programming Languages which features not an ordered list but a graph of the concepts related in the book

His dependency graph for Software Foundations is even cooler, and clickable! http://www.cis.upenn.edu/~bcpierce/sf/current/deps.html

Re:Standardized Ladder of Functional Programming [pdf] by brianberns on Wednesday November 30, 2016 @02:48AM (#13069141)
> This list is very Haskell-focused

I agree. My preferred language (F#) doesn't even support many of the listed concepts beyond "Advanced Beginner".

Re:Standardized Ladder of Functional Programming [pdf] by premium-concern on Wednesday November 30, 2016 @05:20AM (#13069637)
That says more about your preferred language than the listed concepts.

A language limited to a level of advanced beginners is not necessarily bad, though.

Re:Standardized Ladder of Functional Programming [pdf] by chriswarbo on Wednesday November 30, 2016 @09:05AM (#13070739)
I disagree. This list contains lots of "Haskellisms" like monad transformers and lenses, which are effectively design patterns which have emerged over time as powerful ways to work within and around the idiosyncracies of Haskell.

We could argue all day about whether different 'families' of FP languages, like MLs, Lisps, Joys, etc. are more or less "advanced", so let's avoid any ambiguity and stick to the Haskell family of languages. Let's pick a language which is strictly more advanced and powerful than Haskell, such as Agda or Idris: not only can we implement all of the Haskell concepts in these languages (especially Idris, since we can toggle totality checking, rather than having to work around it), but the inclusion of dependent types lets us implement many more powerful patterns, and even simplifies many of the Haskell patterns (e.g. there's no need for hacks like singletons, normal functions can be used instead of type families, etc.).

So, given this vast landscape of new possibilities, which of the many 'design pattern' concepts have been chosen from these ultra-advanced, super-powerful languages?

> Dependent-Types, Singleton Types

That's it! Apparently the only new concept in these languages is the fact that dependent types exist; but even that's been constrained to a Haskell context, by lumping it in with singletons!

There's no mention of proof objects (de Bruijn criterion, etc.), computational content, erasure or proof irrelevance. No mention of tactic languages. They do give kinds and rank-n types, but they don't mention cumulative universes! No HoTT concepts are mentioned, like types-as-spaces, identity-as-paths or univalence. There's not even a mention of intensionality vs extensionality!

So what about skills? Surely there'd be specifics like modelling divergence co-inductively via Partial/Delay? Maybe propagating invariants with initial algebras, even if it's just a Vector example? What about something trivial, like heterogeneous equality?

> Use proof systems to formally prove properties of code.

> Use dependent-typing to prove more properties at compile time

Again, they've just listed that "these things exist", rather than giving any specifics whatsoever.

What about Haskell? Does that exist? You bet! It even has this thing called lenses; and not only do they exist, there are all sorts of nuanced proficiencies to them!

Re:Standardized Ladder of Functional Programming [pdf] by tel on Wednesday November 30, 2016 @09:54AM (#13071190)
Completely agree!

.... except! I really think Lenses are a concept orthogonal to Haskell. They can be implemented anywhere and usually make good sense. I think we have a long way to go before we've come to understand their best place in functional programming—especially construed as widely as you note.

Re:Standardized Ladder of Functional Programming [pdf] by tel on Wednesday November 30, 2016 @01:12AM (#13068828)
> not an ordered list but a graph of the concepts

I like this idea a lot

Re:Standardized Ladder of Functional Programming [pdf] by sitkack on Wednesday November 30, 2016 @11:35AM (#13072103)
I feel like this should be part of dbpedia.