Why aren't you using Haskell right now?

Why aren't you using Haskell right now?

Attached: haskell.jpg (767x541, 27K)

Other urls found in this thread:

haskellbook.com
hackage.haskell.org
twitter.com/SFWRedditGifs

It serves no purpose :^)

because I'm not autistic anymore

The syntax is ass, I hate recursion and I hate the performance and memory use of immutable data structures.

>the syntax is ass
the only better syntax is lisp syntax
>I hate recursion
You should be using higher order functions instead
>performance & memory use
valid concerns

Cause it gets BTFO by C++.

Because I use Lisp.

>You should be using higher order functions instead
Not always possible. Sometimes, you need recursion as a "raw" alternative to iteration. For example, when you need to turn something into a list a certain way that isn't in the standard library.

kys brainlet

Sure, but those are uncommon cases. Explicit recursion should be much rarer than higher order function usage.

It's slow and nothing of value has come out of it. It's great at fueling the illusory superiority of wannabe mathematician CS plebs though.

>Sure
stop samefagging you fucking retard

Attached: 1562245316995.jpg (600x456, 29K)

I bet you also think nothing happened at tiananmen square

>samefagging
??

contents of the ADDRESS part of the register, not curry-howard ISOMORPHISM ok

Attached: LISP patriot.png (828x946, 113K)

It really is funny how it's slower than Java in benchmarks, but the haskell autistics somehow tell themselves that "the compiler is smart and may produce code faster than C".

I've never seen that happen. The only thing it really does faster is recusion, but then it's still just as fast as a loop, without being as versatile.
Lazy evalutation in general is just a waste of memory and cycles since you need those values anyway. Parameters that are never evaluated are simply an exception. This is a situation where an explicit lazy monad would have been better.

>recursion is less versatile than a loop
???
You're right about lazy evaluation by default though, it's a meme.

>helloworld.exe
>13.6 MB
?

whats difference between Int, Integer and Integral?

>Int
A machine integer, at least 29 bits.
>Integer
An arbitrary precision integer.
>Integral
A typeclass covering any type which supports integer operations.

because I like mutability and dislike modelling any change as a complete state transition

thanks user, i was wondering where /mlg/ was. started learning haskell. hope it comes back soon.

Noob here . What's the difference between difference between OOP languages and functional programming languages and where should I use functional programming? I started learning Haskell a while back but I still don't see why I would use it for anything.
t. Uni student with experience in C++ and Python.

haskell isn't used much irl.
ocaml, scala, clojure, erlang are more popular for "real" work

>the only better syntax is lisp syntax
I think Haskell is superior. The core of any functional language is function application and Haskell makes this as simple and clean as possible by reducing the syntax to nothing at all

I think Haskell abuses infix operators too much. Partial application can also hurt readability. These things make Haskell extremely terse and context dependent.

OOP languages - or rather imperative languages in general - have a semantics similar to the model of the turing machine. In imperative languages you store data in mutable variables and manipulate it in your code which executes line by line with functions and structures like loops, if blocks, and switch case statements to control the flow

Pure functional languages have semantics based in lambda or combinatorial calculus. You work entirely in functions which operate by value on immutable data, chaining them together from program input to program output

Functional programmers commonly report benefits in coding time, code length, ease of refactoring, and reduction of bugs. There are some serious negatives as well. Functional languages are not as performant as imperative ones. They are also not as popular, so libraries and tooling are not as good as the best imperative languages

So some things to consider before using Haskell are whether you like it and work well in it, whether reducing coding and maintenance time is more important to your project than tight performance, whether useful libraries for your project exist in the language, and whether using an obscure language is going to hurt your project (e.g. is this project ever going to scale up and need to bring in many new developers quickly)

Agreed on infix operators. I'd just as soon remove them entirely from the language

I also see what you're saying about partial application. However, curried functions and partial application are so damn useful :P

Because I've no need for it

This is why I think Lisp syntax is better. All your functions are prefix and with some basic macros you get incredibly readable partial application. Getting it "for free" in Haskell is what makes it hard to read.

I'm interested in learning haskell, anyone got good resources to recommend? Preferably something like a project with real world use, not only fizzbuzzes, thanks

I'll have to agree here. Overall, I prefer Haskell to Lisp, but Lisp syntax is cleaner, more consistent and more readable, albeit a bit more verbose.
The book "Let Over Lambda" makes an interesting observation about syntax, comparing Common Lisp to Perl: the former is what happens when you take syntax away, the latter is what happens when you take syntax all the way. Both have benefits and drawbacks: the reasoning is that if you're gonna have more syntax (which makes metaprogramming much harder, if not impossible) you might as well go balls deep and have lots of syntax, in order to compensate for the lack of metaprogramming with a richer language.
Haskell syntax is in this awkward middle ground where it doesn't really have either benefit IMHO.

haskellbook.com is quite a good book for learning. It has chapter assignments to work through if you want, but if you're looking for a larger project Haskell does have enough libraries available that there isn't a lot restricting you from just picking something you're actually interested: hackage.haskell.org

I disagree. I can't think of many situations in Haskell where the syntax is too limiting and metaprogramming would help. A lot of the stuff that might have been metaprogrammed in other languages can just be done with weird operators.

thanks user

because I have a job

Because everyone laughs at me whenever I use it.

FP will make you view problems from difference angles. You're better than, like, other 90% of programmers if you understand it. While Haskell isn't a bad choice for learning FP, I recommend learning Lisp instead (Common Lisp or Scheme is fine) because, imo, Lisp syntax is clearner, the language is easier and even it's not as purely FP as Haskell but it's enough to give you a taste of FP.

Go is better

I do have a YMCA membership, OP.

idk how to use it :(
it's just the lambda calculus
The syntax is ass because it's not well documented, i once googled what the shit are the difference between '$' and '.' and couldn't find anything official or concrete, it's like they're the same but not really but in most cases they are interchangeable with no 200 line ghc errors popping up.

>You're better than, like, other 90% of programmers if you understand it.
no, you aren't

>i once googled what the shit are the difference between '$' and '.' and couldn't find anything official or concrete
$ is the identity function specialized to functions, . is function composition.
in other words
f $ x = f x
f . g = \x -> f (g x)

thank you user

>1971 pages
Holy mother of paper bricks what's this?

t. person who doesnt benchmark

The hell you need a identity function operator in your language?

Because then you can do
f . g $ a + b
instead of
(f . g) (a + b)

Haskell book.

It has a high page count but the pages are small.

So you use it as a "one side parens" of sorts?

Scala is enough

You don't "need" it but it's convenient.
foo $ bar $ baz x is equivalent to foo (bar (baz x))
You can also have the operator & which is the same as $ but flips its arguments so you can write chains of functions similarly to the method chaining style in OOP languages.
x & map (+1) & filter even & product

dont know if composing functions or calling me a fag

Kind of, I don't think you can use it to pass multiple arguments to a function though, e.g.
f $ a + b c
as far as I can tell, you have to use parens for that.

Yeah, the point is to reduce the amount of brackets needed in some expressions, like:
main = putStrLn (show (map (+1) (someFunction a b c)))
-- or instead
main = putStrLn $ show $ map (+1) $ someFunction a b c
-- or instead, with the composition operator
main = putStrLn . show . map (+1) $ someFunction a b c

The last two are the same in this case, but the last one without the $ would become a new function, while the one above it without the last $ would try to call show with the args map and (+1).

Basically '.' takes the output of a FUNCTION on the right hand side and sends it to the left but '$' can take almost anything on the right hand side.

I might be wrong but that is my understanding of it in simple terms.

bitch I might be

topkek

Do you guys actually reason about commutative diagrams; universal properties; limits; duality; exact sequences; exactness, faithfulness, and variance of functors; natural transformations; pre-additive, abelian, and small categories, &c?
That is, do you guys actually reason about your stuff in a category-y/generalized abstract nonsense way?

Also bump

why the 29bit minimum?
is int16 not an int, and if so why?

Because D covers my need

Yoneda's lemma is a meme, nobody cares about this stuff

This, also muh 500 lines of {-# LANGUAGE #-} in every file making it an even more bloated and nonstandard piece of shit than C++.

I assume the remaining bits are useful for garbage collection, ocaml does something similar.
Int16 != Int but will have an Integral instance.

>lisp
>functional
End this memery. Lisp (especially Common Lisp) is great, but it's not, nor has it ever been, a "functional" language in the sense it's commonly agreed upon nowadays. Not only do many idiomatic constructs encourage mutability and iterative approaches, macros give you a whole new way of violating referential transparency.
Yes, you can program in a more functional style if you really want, but Lisp truly shines when you embrace mutability instead of fighting it.
That's also the reason I tend to dislike Scheme: to me, it just feels like an attempt to turn Lisp into something that isn't Lisp.