/hask/ Haskell and Functional Programming Thread

>What is functional programming (FP)?
A programming paradigm that reduces (almost) everything to functions. The most important features of FP are first-class functions and tail call optimization. Immutable data isn’t a necessary FP feature but is often seen in FP languages nonetheless.
>What is Haskell?
A ML-family functional programming language with lazy evaluation and a powerful type system.
>Why should I learn it?
It's more interesting than other employable languages and more employable than other interesting languages.
>How do I learn it?
Read a book like "learn you a haskell for great good", "get programming with haskell" or "haskell programming from first principles".
>But those books cost money!
Just [REDACTED] them lol
>What other functional programming languages can I learn?
Idris - Has dependent typing. Very fun but still under development
Clojure, Scala - Java ecosystem but tail recursion doesn't work as well. Clojure is also dynamically typed
Racket - A functional (as in FP) Lisp with tail recursion. IDK much else about it
OCaml - Another ML-family language.
F# - Another language in the ML family. Can use the .NET ecosystem

Attached: lyah-jakphant.png (984x1300, 425.35K)

Other urls found in this thread:

youtu.be/h_D4P-KRNKs
twitter.com/SFWRedditImages

previous thread -

Attached: get programming with haskell cobson fixed.png (775x1127, 171.63K)

What haskell jobs are there? seems like most math-centric programming jobs use python

Highly varied. There’s blockchain stuff, there’s webshit, there’s fintech, there’s using Haskell to generate C code (for example, at Tesla), and probably some other stuff as well.

Is it worth it to try and write as close to functional programming style in languages that aren't strictly functional? I keep getting told that OOP done right looks a lot like functional programming.

>functional meme
I want to go back to when the meme of the decade was OOP instead of this garbage.

I want to learn Haskell so bad but I need a job so I'm sticking to pure webshitter shit for now. Sucks. At the very least I have tried to write functional javascript solutions to some problems.

>Is it worth it to try and write as close to functional programming style in languages that aren't strictly functional?
Some ideas (like first-class functions) work great. Others, not so much; recursion, for example, works poorly in most langs because tail calls aren't optimized
>I keep getting told that OOP done right looks a lot like functional programming.
The concepts aren't mutually exclusive.
On the bright side, no pajeet interviewer is going to ask you "saar what are four principles of fanctional programming" or "saar explain usage of shitinstreetinator design pattern"

Learn Elixir.

OOP is extremely harder to do right than FP. You will understand monads before you understand how to do OO without being a jeet

Why?

>recursion, for example, works poorly in most langs because tail calls are broken
FTFY

Any good YouTube playlists regarding Haskell? Have to learn it for a class and I’ve read the first 7 or 8 chapters of LYAHFGG but I think I need a little more help

Clojure has no tail recursion but does have limited support for self tail recursion using a special keyword
I'd say another important feature of modern FP languages is polymorphism

what is Haskell even used for? what are its applications? i understand the benefits of the language's features itself

Strict FP/excessively typed languages like haskell are a lot like trannies: practitioners get themselves off to the thought of becoming a master haskell programmer even though in practical terms it's a useless language and they will never use it to write real software.

See

youtu.be/h_D4P-KRNKs

Haskell is my new favorite language. I've been learning it for a year now.

I still don't know yet how to print "Hello World", but it's a side effect anyway, right?

>what is Haskell even used for?
Nothing.
>what are its applications?
Jerking off about muh pure functional language.

is it just me or the elephant on the cover does indeed look like a crying soijak?

Is haskell nicer than common lisp?

hledger is my favourite haskall program

If you're comparing haskell to common lisp you probably don't know either.
They literally have nothing in common.