I TEACH HASKELL

itt; haskell beginners ask me questions

ill start with what haskell is

haskell is a general purpose, purely functional programming language .
it provides:
>higher-order functions (functions that can take functions as arguments and return functions too)
> static polymorphic typing (meaning functions that can work on any datatype)
>user-defined algebraic datatypes
>pattern-matching
>list comprehensions
>a module system
>a monadic I/O system
>a rich set of primitive datatypes, including lists, arrays, arbitrary and fixed precision integers, and floating-point numbers

spoiler: I'm not an expert by I know my way around.

Other urls found in this thread:

wiki.haskell.org/Haskell_in_practice
learnyouahaskell.com/
twitter.com/SFWRedditGifs

Why would I want to use this shit instead of tried and true programming constructs like loops, conditional jumps and state machines with side effects?

It's how a computer actually works.

What's the advantage of learning it?

Give me a category theory primer right now, with accurate mathematical notation.

congratulations. you've managed to list every trivial haskell feature without mentioning the interesting stuff

although haskell doesn't have those constructs, it sure can emulate it
i.e.
for i in range(1,20):
print(i)

is the same as
map print [1..20]


functional programming allows one to be more expressive
stuff like for, while requires state, and haskell in itself is purely functional
state is non-pure
there's better ways to achieve the purpose of iteration within haskell and fp in general

you'll get a taste of what fp is about
since haskell is very high level, code will be much shorter thatn the imperative counter part
also, the syntax is fucking hot

read the spoiler in

Can you provide a non-meme answer that doesn't mention state?

Why should you care?
Also, why the fuck does the GHC require a 2GB runtime?

Come on. If you don't even know basic category theory you shouldn't be giving advice on python and talking about "getting a taste for fp".

I meant haskell there

not OP, but it's actually really nice for solving some mathematical problems.

you don't need category theory for haskell though
because its useful to isolate purity and non-purity
i.e. allows you to modularize your code and helps you reason about it

also, ghc's fucking bloated, and only a gig, thats why

Would it be possible to write something like a game or a word processor in a purely functional language? How would you handle those sorts of things without using state?

How's Haskell for someone that only knows a little bit of Python and sucks at math?
Asking for a friend.

Aside from memes and fizzbuzz writing what are the real world applications for functional languages? Where are they used/usefull?

Good for first language ?

Haskell is obsolete.

Different approach to mutability, not really comparable.

state is possible in haskell, its just segregated
I learned python a bit before doing haskell
and here I am
I only know haskell to a great extenent

wiki.haskell.org/Haskell_in_practice
I'm not sure.
You can try it.
No, do try it.
Haskell's pretty logical and the type system will make everything make sense

>state is possible in haskell, its just segregated
What exactly do you mean by "segregated"? What data structures are possible in Haskell?

don't kid yourself, Haskell's module system is useless

segregated meaning it can be contained
actions are contained in a type called IO

any data strucutres are allowed in haskell
data Tree a = Node a [Tree a]

is a tree structure
it can also be a graph, but graphs are more complicated

the data keyword allows one to make any type of data structure, whether they have constraints is up to the functions that work with such data structures

how come?

if its purely functional does that mean you cant implement OOP in it. If not doesnt that mean you cant create any real program in it since mutation is pretty critical for programs today.

Links to guides?

I believe someone was able to emulate OOP in haskell.
learnyouahaskell.com/

Where's an IRC room where Haskell nerds can get together to work on shit?

#haskell on irc.freenode.org