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.
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.
Jonathan Price
What's the advantage of learning it?
Hunter Price
Give me a category theory primer right now, with accurate mathematical notation.
Aaron Foster
congratulations. you've managed to list every trivial haskell feature without mentioning the interesting stuff
Joshua Turner
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
Levi Hall
read the spoiler in
Robert Anderson
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?
Nathaniel James
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".
John King
I meant haskell there
Justin Jenkins
not OP, but it's actually really nice for solving some mathematical problems.
Kevin Moore
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
Grayson Powell
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?
Austin Watson
How's Haskell for someone that only knows a little bit of Python and sucks at math? Asking for a friend.
Joseph Adams
Aside from memes and fizzbuzz writing what are the real world applications for functional languages? Where are they used/usefull?
Ethan Nguyen
Good for first language ?
Landon King
Haskell is obsolete.
Angel Howard
Different approach to mutability, not really comparable.
Joshua Cook
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
Eli Ross
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
Josiah Gutierrez
>state is possible in haskell, its just segregated What exactly do you mean by "segregated"? What data structures are possible in Haskell?
Brody Johnson
don't kid yourself, Haskell's module system is useless
Zachary Jenkins
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?
Samuel Campbell
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.