Haskell is undeniably, completely, and truly the best programming language. Whoever disagrees is objectively wrong.
Are you fucking retarded? Lisp has no monads, monoids, functors, fucking nothing other than simple types and recursion. It's like the retarded shitbaby of functional programming languages.
I'm not sure I follow.
Simply beautiful.main = putStrLn "What's your name?" >> getLine >>= putStrLn . ("Hello " ++)
>implying that ugly ass bullshit is better
That is what I am implying.
>implying that lack of pureness is a good thing
How does the Haskell do input/output? Oh right, it uses a monad, whatever the fuck that is.
>Implying people actually write programs in Haskell
They'd never sully it's purity and beauty. Anyway, that would east into valuable time to spend wanking over the purity and beauty of the language.
Monads are cumbersome because they're too sequential.
If you write x + y you don't care whether x or y is fetched first (or both at the same time) but in Haskell you have to order the reads explicitly, which isn't even necessary in some assembly languages.
I don't understand it because I have better things to do with my time then learn the complicated ins and outs of a system based around pride and its own complicated nature.
No decent computing books use Haskell. This is because Haskell is relatively new compared to many other languages and because it is overly complicated.
TAOCP uses an assembler language. SICP uses Scheme. You can see the pattern here.
Why do you like Haskell so much?
When you program stuff in a sane language for a while, say C#, you notice that the functional idioms are great. You also notice that the most common issue in your programs is a runtime exception, null pointer reference to be exact.
Okay so with Haskell we get rid of that. And we also get rid of a lot of other problems, because we have the nice things: monads, immutability, pattern matching etc.
Bad things? I don't really know. At some point I'm gonna run into problems with laziness. And at this point, most of the discussions in the community go way over my head. This is not a problem per se, just makes the community and the language seem more intimidating than necessary.
Elixir is a pure functional language that has syntax that is as clean and intuitive as Ruby and has the best concurrency built into the VM, eventually Elixir will make js and Ruby obsolete both in frontend and backend web programming
for speed and static type inference, Ocaml is superior to Haskell
Haskell is a bit of a PITA in terms of deployment across platforms with all the dependencies that really are crappy to manage with cabal-install and stuff like that.
I really don't like that very much.
It's actually very readable in most cases...
>The only reason OCaml is still around is because Haskell is lazy and sometimes laziness is harmful.
the language designers have admitted over and over that default laziness does not bring increased purity, safety or runtime optimizations
people using Haskell are using a needlessly complicated language simply because they bought into snake oil hype
I agree about laziness but Haskell's type system and type inference is better than OCaml's.data Tree a b = Branch (a (Tree a b)) | Leaf b
data Pair a = Pair a a
a = Branch [Leaf 1, Branch [Leaf 2, Leaf 3], Leaf 4]
b = Branch (Pair (Leaf 1) (Branch (Pair (Leaf 2) (Leaf 3))))
In OCaml, AIUI, you would need explicit modules and type inference won't work there.
Laziness may not make the language more pure, more safe, or faster, but it is convenient.
Generate a list of all numbers:[1..]Find the ninth number divisible by both 9 and 7:
(filter (\x -> x `mod` 9 == 0 && x `mod` 7 == 0) [1..]) !! 9
Generate a list of all prime numbers (assuming that you have a function that find if a number is prime):
filter isPrime [1..]
Find the first prime number greater than 6534:
head $ filter (\x -> isPrime x && x > 6534) [1..]
Or, do the same thing:
head $ filter (>6534) (filter isPrime [1..])
What is formatting
Generate a list of all numbers greater than 1:
Find the ninth number divisible by both 9 and 7:(filter (\x -> x `mod` 9 == 0 && x `mod` 7 == 0) [1..]) !! 9
Generate a list of all prime numbers (assuming that you have a function that find if a number is prime):filter isPrime [1..]
Find the first prime number greater than 6534:head $ filter (\x -> isPrime x && x > 6534) [1..]
Or, do the same thing:head $ filter (>6534) (filter isPrime [1..])
I find debugging a Haskell program that actually compiles to be somewhat difficult. I've been trying for the past few days to augment xmonad with some functionality that will move the currently focused window to a free workspace and then switch the view to that workspace. It moves the original window and switches to the correct workplace, but the original window is hidden ... somewhere ... rather than on the workspace I intended it to go to. I can't figure out what is wrong and can't set a breakpoint because the order of execution is below my level of abstraction.
Are there any languages kind of like Haskell but with side effects and mutability? I have heard of disciple but never used it. I have used OCaml but don't like the lack of overloading. TypeClasses are nice and intuitive, sometimes using a module for everything is too heavy-weight.
Haskell has the most complex type system of almost any language. It'll let you do some weak typing, but almost no one uses that feature, because you'll likely end up with a function returning a type you didn't intend it to return.
Solid justification as to why it's the 'best'. Functional programming isn't good for most most problems anyway.
I think languages like Scalla which have a nice blend between the imperative and functional style is the future.
Types in Coq, Epigram and Idris:
>this function returns a list of prime numbers that when multiplied results in the input
Types in Haskell
>This function could possibly return a list of numbers
Scala:sealed abstract class Tree
case class Node(left: Tree, right: Tree) extends Tree
case class Leaf[T](value: T) extends Tree
case object Empty extends Tree
Haskell:data Tree a = Empty | Leaf a | Node (Tree a) (Tree a)
Why do I keep going to this place? Why do I do this to myself? This is not a productive website. It's just a bunch of people who brag about their limited knowledge and are hostile over the smallest things. Why do I keep returning? Do I hate myself that much?
I am planning on learning Haskell sometime this year because FP looks sexy.
Meanwhile this is what I work with when not at $DAYJOB. Shit is $$$.
So to be serious, it's just for my local network. I've been moving all my files to central home server to keep it from getting fragmented so now I'm going to try and make a server-side program to organize and view all the shit I download from 4chan and boorus.
I could probably use existing booru software, but their UIs aren't really great if you want to take full advantage of LAN speed/bandwidth (i.e. being able to scroll through full-size images instead of just thumbnails).
I'll probably put it up on Github once I have a decent footing with Haskell. Hopefully other anons will like it.
Ada does look like that.
I have heard from a lot of sides that Ada's adoption was hampered due to slow initial compilers and government ties. Even though business, academia and government participated.
Some trivia - Ada is the only language GCC does not translate to C first before producing assembly code.
>Some trivia - Ada is the only language GCC does not translate to C first before producing assembly code.
I thought GCC had different frontends for each language it supported that translated them into the intermediate language GCC uses.
Dependent types are indeed more powerful. But none of these languages are useable enough to do real-life stuff, it's a pity...
Types in these languages are more precise than the ones in Haskell, which is good and they are forced to terminate. But it is a hassle to write functions like that.
>Ada does look like that.
Just looking at the 1979 reference manual, there are a lot of syntactic features in Red that Ada doesn't have which makes it feel more modern than C/C++ and Pascal. Ada is more verbose than C but Red was less verbose and much more elegant than C. This verbosity led to the reputation that Ada is one of those cumbersome languages like COBOL and so people used insecure languages instead.
In Ada, you have to declare subprograms and types at the top of a block before you can use them. In Red, statements and declarations can be mixed and subprograms can be called even if they are defined further down in the program source.
In Ada, you have to explicitly instantiate a generic. In Red, it's automatic and the compiler determines the necessary types, like with C++ templates.
In Red, you write an export list at the top of a module like you do in Haskell.
These make a language more pleasant to use.
I think some of these changes were because of a government requirement, but people writing ordinary programs don't need these requirements.
Oh, nice observations!
Technically, ada does allow you as you probably know, to deckare variables further down with DECLARE/BEGIN/END.
But yeah, I don't know the motivation behind not choosing red. Or did they choose it and then reworked it? I forgot all about red green blue and strawman tinman etc and how it worked.
They chose Green. The Red and Green documents are available online. I've never seen Yellow or Blue.
I read that there were 17 Ironman and 4 Steelman (the 4 colors).
One of the Ironman languages was called TARTAN.
>it is overly complicated
>I don't understand it therefore it's complicated
It's an incredibly simple and elegant language based on intuitive mathematical concepts. A lot of universities use it in introductory classes.