26 karma · joined Sep 8, 2016 (10y ago) · 7 submissions
comment 9y ago · link · parent
The language itself doesn't demand we write code this way, but the community, understandably, loves to be as expressive as possible in many cases.
But all of this comes with a cost of cognitive overhead that seems to rarely be worth paying.
Elm was an enlightening experience for me, having started with Haskell, because it helped me to realize just how little I ever took advantage of a lot of the very generic Haskell code, and how far the simplest of functions and types could take you in the overwhelming majority of cases.
comment 9y ago · link · parent
-- Using Elm syntax
pipeline : List (Int -> Int)
pipeline = [(\x -> x + 3), (\x -> x * 2), abs]
applyPipeline : Int -> Int
applyPipeline value = List.foldr (\func val -> func val) value pipeline
-- or more succinctly
applyPipeline_ value = List.foldr (<|) value pipeline
Getting lost in the mathematical abstractions is really no help here. In niche circumstances I'm sure it's great, but like.... not here.
comment 9y ago · link · parent
But you can have the bulk of these wins in a simpler language like Elm, or a language like Rust which tries to only add more type complexity in cases where it would significantly improve code in practice, rather than in theory.
Haskell is necessary; it pushes the state of the art forward because of how experimental it is (compiler extensions). But it's pretty clear that the community is skewed towards research rather than industry, and culture strongly influences what a language is practically capable of.
This does not at all mean that Haskell isn't fully capable of industrial applications; we have direct evidence suggesting otherwise. But with a philosophy to "avoid success at all costs", it should be fairly clear that moving out of the realm of obscurity isn't exactly a goal of the language.