4 ms·
Personally, I've written zero lines of production Haskell code, and expect that this will still be true when I retire. Despite that, learning Haskell was proba
by pliftkl 6y ago
Personally, I've written zero lines of production Haskell code, and expect that this will still be true when I retire. Despite that, learning Haskell was probably one of the best things that I've ever done. The learning process sent me down lots of interesting rabbit holes of language design, and certainly made me a more disciplined developer in other languages. The lambda calculus and predicate logic discussed in this article was one of the enjoyable rabbit hole trips induced by Haskell, but it was only one of many.
- nandhinianand 6y agoPlease do write about other rabbit holes too.. ..If not a long form article, a short compilation of the holes (and links if you can find the time to get them) would be very useful.. I've been interested and flirting with haskell for a while, but become too time-poor the last 4-5 years to do anything even hobby level.
- alpaca128 6y agoI don't know Haskell, but I'm pretty certain that something I recently discovered also applies there: Dependent Types In short, it's a way to restrict the data types to such a degree that the type checker can do compile-time checks of array sizes and other interesting things, as those aspects are directly expressed as distinct types depending on each other. The principle requires a pretty powerful type system and is cumbersome to use, but I found it fascinating regardless.
- exdsq 6y agoCheck out type-driven development (there are books on using Idris for this) -- it blew my mind! You do what you're talking about to encode business logic that's checked at compile time.
- vram22 6y agoI had checked out F# for a while, some time earlier. IIRC, it has some features like that, for encoding business logic in code/types. Probably some other languages do too. I had mainly used Scott Wlaschin's site F# for Fun and Profit, and MS sites, for F#. Edit: Also had looked at OCaml, via Real World OCaml, and also much earlier, via INRIA / O'Reilly sites / books / software. F# may be based on OCaml. Both resources are free to read online.
- Jeff_Brown 6y agoErgonomic dependent types are probably coming to Haskell in a couple years. It already has them in a way but it's currently harder than it will be in the future. https://gitlab.haskell.org/ghc/ghc/-/wikis/dependent-haskell https://gitlab.haskell.org/ghc/ghc/-/wikis/dependent-haskell
- nandhinianand 6y agoHmm.. interesting.. i was and still am excited about the type inheritance. Alas I code with python for a living.. :-(
- nandhinianand 6y agoOoops i meant to say type inference.. Ah well fat fingers.. or is misconnected synapses between Broca's area and the motor cortex?? shrug whatever.
- jonathanpoulter 6y agoI completely agree with this sentiment. Writing good Haskell always seemed harder to me than something like Python. The amount I'd have to think before beginning to type was a lot, but it always seemed worth it, as there was always potential always for a beautiful solution to any problem. As a result, before I write code in any production language I give a little more thought to what I'm about to write, which I think ends up with a better result. Heck, even if Haskell just gave a developer an appreciation for basic functional programming, that would be something that will benefit them for years in my view.
- siraben 6y agoI second this statement. I find that my code across different paradigms (imperative/OO/FP) has become a lot cleaner as a result of learning a purely functional language that makes it impossible[0] to call an impure function from a pure one, among other things. Also, since Haskell has a lot of advanced type system features, whatever feature that gains traction in other languages (traits in Rust and Swift, optional chaining, async/await) I find much easier to learn as they are usually specializations of more general concepts in Haskell. And as someone who also studies mathematics, the connections between functional programming and areas like logic, order theory and category theory run deep—programs can too become objects of mathematical study, with their correctness proved and refactoring sound. [0] with exceptionally rare caveats
- gspr 6y agoAs others have said: same! In addition to expanding my thinking and making be a better developer in other languages, I think Haskell has made me expect more of programming languages. In a positive way. Things can be better than they are. That doesn't mean things should be Haskell. But they can be better.
- wiz21c 6y agoHad the same experience while learning scheme. Lazy eval, continuation, continuation-passing-style, coroutine, OOP (yes!), lambda stuff, dynamic/lexical scope, closure, thunks, tail recursion (not all of that is specific to scheme of course, but you get the idea)... I'm still not OK with monads though :-)
- MaxGabriel 6y agoI’ve been using Haskell in production for three years and it’s been great so far! I think these concepts translate to other languages fairly well, and are easy to learn in Haskell: - Newtypes (Languages like Kotlin/Swift have support for them, and you can kinda get close with lots of classes in Java) - Purity (can write “pure” code in most languages) - Algebraic Data Types (help with thinking about modeling data, works in eg TypeScript) - Maybe / Optional types (Now very popular in other languages) - Parser Combinators (work in eg JavaScript)
- nextos 6y agoUndeniably, lots of ideas from pure lazy typed functional programming languages (some pioneered by Haskell) have influenced mainstream languages. Thus, by learning Haskell one can adapt to mainstream languages fairly quickly. However, I think there are still some extremely interesting ideas that can only be implemented in Haskell and some related languages (e.g. Joy) which may prove very useful. One can see the glimpse of that in Compiling to Categories [1]. In general, programming in a point-free way may lead to lots of advantages we don't understand well yet [2-3]. I think, for example, synthesizing point-free programs should be a cool path towards AI. [1] http://conal.net/papers/compiling-to-categories/ http://conal.net/papers/compiling-to-categories/ [2] https://www.cs.nott.ac.uk/~pszjlh/pcalc.html https://www.cs.nott.ac.uk/~pszjlh/pcalc.html [3] https://www4.di.uminho.pt/~jno/ps/pdbc.pdf https://www4.di.uminho.pt/~jno/ps/pdbc.pdf
- AzzieElbab 6y agoClosest thing to Haskell in production I've worked on were pure fp Scala projects
- isatty 6y agoSince many people are agreeing with you let me disagree for the sake of doing so: I’ve used Haskell in production (not a very big service but anyway) and while I enjoyed it, I think that it was at the cost of my employer. Spending my time studying about lambda calculus and suffering through slow compile times of GHC isn’t a very rewarding experience (for me personally). IMO I’m still a better programmer for knowing the concepts of, but not by much. It’s a field bigger than Haskell and IMO writing production Haskell code only skims the surface of lambda calculus/theory.
- exDM69 6y agoHaving a background in Haskell (and C) made me able to jump in and be productive in Rust within hours. And that's a language that is considered to have a steep learning curve. Never used it in production either but I did use Haskell to ace some of my advanced computer science course work with less time and less lines of code than my peers.
- chungus 6y agoI concur, for me the journey was: Java -> Clojure -> Haskell -> Rust. Each language introduced concepts that made it easier to learn the next. So far I've had jobs in all of those languages except for Rust, but that time will come too. I still prefer Haskell for everything that doesn't involve GUI's.
- jcelerier 6y ago> The lambda calculus and predicate logic discussed in this article was one of the enjoyable rabbit hole trips induced by Haskell, but it was only one of many. ... aren't those very basic things that are taught in the first years of any comp. sci. university ?