Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon.

Pages: 1-4041-

WTF, Haskell?

Name: Anonymous 2012-01-08 2:05


Prelude> (+) 1 2*3
9
Prelude> (+) 1*3 2

<interactive>:1:0:
    No instance for (Num (t -> t))
      arising from a use of `*' at <interactive>:1:0-8
    Possible fix: add an instance declaration for (Num (t -> t))
    In the expression: (+) 1 * 3 2
    In the definition of `it': it = (+) 1 * 3 2

<interactive>:1:6:
    No instance for (Num (t1 -> t -> t))
      arising from the literal `3' at <interactive>:1:6-8
    Possible fix: add an instance declaration for (Num (t1 -> t -> t))
    In the second argument of `(*)', namely `3 2'
    In the expression: (+) 1 * 3 2
    In the definition of `it': it = (+) 1 * 3 2
Prelude>

Name: Anonymous 2012-01-08 2:51

Functions have higher precedence than operators.

Your first line means this:

((+) 1 2) * 3


Your second line means this:

((+) 1) * 3 2

which is naturally invalid

Name: Anonymous 2012-01-08 2:59

>>2
Confusing.

Name: Anonymous 2012-01-08 4:42

>>3

yes. I quickly get in the habit of putting parenthesis around every subexpression, and it all ends up looking like lisp anyways.

Name: Anonymous 2012-01-08 6:14

It can make for very light code:

foo . map bar . foldl baz bar . filter foobar . baz

Name: Anonymous 2012-01-08 8:25

>>5
That's not light, it's actually very dense. Haskell programs are awesome because one can compress a non trivial amount of code into deceptively clean code like that.

Name: Anonymous 2012-01-08 8:37

GC is shit.

Name: Anonymous 2012-01-08 8:38

>>7
LinearML and Linear Lisp need no GC.

Name: Anonymous 2012-01-08 9:10

If linear Lisp has no GC, which is obviously superior, why this innovative feature hasn't caught on?
I suspect there some flaws in this "Linear Lisp" approach which the author doesn't mention.

Name: Anonymous 2012-01-08 9:13

the plot thickens

Name: Anonymous 2012-01-08 9:56

>>8
Don't bother telling a militant anti-LISPer such things. They'll just continue spouting diatribes about things they have little to no knowledge of.

Name: Anonymous 2012-01-08 11:41

>>6
I obviously meant syntactically light. How did you not get that?

Name: Anonymous 2012-01-09 6:14

Haskell is annoying
- rich-syntax: rich syntax impedes metaprogramming and complicates parsing by human and machine alike
- static-typing: impedes flexibility and complicates semantics for human and machine alike
- call-by-name: makes it hard to reason about evaluation for human and machine alike

Name: Anonymous 2012-01-09 7:42

>>13
It's not that rich.
Haskell's type system is flexible enough.
CbV and CbN have both advantages and disadvantages. Neither is a silver bullet. Eta-equivalence and product types are broken under CbV, sum types are broken under CbN. Haskell has strictness annotations.

Name: Anonymous 2012-01-09 8:48

>>14
type system
flexible

/0

Name: Anonymous 2012-01-09 8:51

>>15
No, type system does not mean Java. Go back to /g/.

Name: Anonymous 2012-01-09 8:52

>>14
CbV and CbN have both advantages and disadvantages. Neither is a silver bullet.
CbN has only useless mathematical "advantages", which are harmful in pracitce if you aint into theorem proving. Mathematics isn't know for intuitivity, while CbV is pretty intuitive and corresponds to layman view of the world.

It's not that rich.

Lisp                       | Haskell
---------------------------|----------------------------------------------------
Prefix notation.           | Prelude> let fac 1 = 1; fac n = n * fac n-1
                           | Prelude> fac 4
                           | *** Exception: stack overflow
                           |
                           | Prelude> let f 1 = 1; f n = ((*)(n)((f) ((-) n 1)))
                           | Prelude> ((f) 4)
                           | 24

Name: Anonymous 2012-01-09 8:53

>>16
type system means mathematics, theorems, rules and self-imposed restriction. harmful stuff.

Name: Anonymous 2012-01-09 9:32

>>18

Mathematics harmful? Programming *is* applied mathematics. The language really doesn't matter. It is just the hammer you use.

Name: Anonymous 2012-01-09 9:42

>>17
Some people like having much more readable code and less to type when the only drawback is having to spend 5 minutes learning a couple precedence rules.

Name: Anonymous 2012-01-09 10:01

>>19
Programming has no "Infinity" and there is Lisp, which has beautiful prefix syntax.

The language really doesn't matter.
You cant have macros in Haskell. Neither you can have `eval`, cause Haskell is a useless piece of shit.

>>20
Haskell
more readable code

flip flip snd . (ap .) . flip flip fst . ((.) .) . flip . (((.) . (,)) .)

spend 5 minutes learning a couple precedence rules.

! <+> <> +++ <-> <|> // <$> </> >< ## $$ << <?> ==> !! # $+$ /=? <&>
|+ |- &&? .* .|. <$$> <.> <||> ==? ? \\/ ||? !> $ && &&& &&@ *. -<-
-=- ->- . .&. .&.? .= /=@ /\\ <*> <+ <. <//> <:> <== <=> <=? <=@ <?
<@ <|*|> =<< ==@ >-> >. >:> >=> >=? >=@ >>> >? >@ \\\\ ^ ^^ |* |> ||
||* ||+ ||@ ||| ~: ~? ~~ !!! !-> !.! !>>= $! $$= $=! $> $~ $~! % %:
%= & &&. &> * *& *&&&* *&* ** *** ***** *<<<* *=* *=>* *> *>>>* *|*
+ ++ ++>> +/+ +: += +> +>> - -!- --> -->> -/\\- -::- -< -<=- -=> -?-
-?> -?>> -\\/- -| -|- -~> .$. .+ .++. .--. .-. .->. ... .... ./. ./=
.: .< .<= .== .=> .> .@. .\\. / /+/ /- /=&& /=. /==> /=> /=|| />/ /|
/~ /~? :+ :-> <$ <$?> <* <**> <++ <++> <-$ <-- </=? <<! <<< <<^ <<|
<<~ <=. <==? <@> <|?> =$$= =$= =*= =/= =< =<<! =<= =<>= ==&& ==. ===
===> ==|| =>> =~ =~~ >*> >++> >-- >=. >== >===> >=>=> >> >>= >>=#
>>@ >>^ >|< >||< ?&&? ?+ ?? ?||? @=? @? @?= @@ \\== ^# ^% ^. ^<< ^>>
^^. ^^^ |*| |-| |. |..| |.| |/ |// |: |<- |= |=| |? |\\ |\\\\ ||.
|||| ~=? ~> ~?= ~|||~ ~||~ ~|~ ~~> ~~? ~~~>

Name: Anonymous 2012-01-09 10:09

>>21
You don't have to know all precedence rules. 99% of the time all you need is basic arithmetic precedence and functions > operators. This alone makes code much more pleasant to read and write.

flip flip snd . (ap .) . flip flip fst . ((.) .) . flip . (((.) . (,)) .)
So you wrote down some random operators and function names that don't make any sense. Your point being?

Name: Anonymous 2012-01-09 10:17

>>22

You don't have to know all precedence rules.
No. I dont. I'm using Lisp.

This alone makes code much more pleasant to read and write.
Yep! Having no stupid rules makes coding much more pleasant.

some random operators and function names that don't make any sense.
Exactly how Haskell looks to a layman.

Name: Anonymous 2012-01-09 10:41

Inference, type classes, algebraic data types, existential types, phantom types, kinds types... haskell completely consists of buzzwords!

Name: Anonymous 2012-01-09 11:06

>>24
Forgot curryhoward isomorphism, lambda cube and dependent types

Name: Anonymous 2012-01-09 11:17

>>24
leave Haskell to the big boys.

Name: Anonymous 2012-01-09 12:13

>>21
You cant have macros in Haskell. Neither you can have `eval`, cause Haskell is a useless piece of shit.
Show me a Common Lisp YACC parser.

Name: Anonymous 2012-01-09 12:22

Name: Anonymous 2012-01-09 12:24

>>28
A YACC parser for Common Lisp.

Name: Anonymous 2012-01-09 12:26

>>27
http://www.pps.jussieu.fr/~jch/software/cl-yacc/

Probably the only use for it is to convert C/C++ to Lisp. Hope someday all programs will be converted to Lisp, which will run on a real Lisp Machine.

Name: Anonymous 2012-01-09 12:29

>>30
You're still a retard with no possible future as a computer programmer.

Name: Anonymous 2012-01-09 12:33

>>31
Better being a retard, than sucking Java/Rails/PHP cocks.

Name: Anonymous 2012-01-09 13:45

I had a dream about sucking cocks. Though it was a woman's.

Name: Anonymous 2012-01-09 15:06

if you were looking for a powerful and elegant language then you missed python

Name: Anonymous 2012-01-09 21:14

Cant believe Haskell is a serious language, there is so much wrong with it! Maybe Haskell's seriousness manifests in it's own esoteric way, incomprehensible without some kind of borderline personality disorder? In any case, Haskell feels like a very marginal language.

Name: Anonymous 2012-01-09 21:58

>>17
so you program by heart?

Name: Anonymous 2012-01-10 1:27

>>36
Nope. It's goes like that: you're studying "Real World Haskell", the chapter about some prepromorphisms, and then something in your head goes "click" and you suddenly realise how ridiculous this static typing is, and your last thoughts abruptly sink into pure laugh caused by a sheer idiocy of Haskell World.

Name: Anonymous 2012-01-10 2:14

>>37
You're too slow to follow the math thread eh?

Name: Anonymous 2012-01-10 3:11

I think lazy data structure manipulation functions are cooler than all-around lazy evaluation.


(first (filter


is nicer than


(find-if


because it means there's one less function in the language.

Or being able to define penultimate as (second (reverse

like, I don't feel totally comfortable abandoning loops if I don't have something sort of equivalent of break... that's what lazy lists give you.

Name: Anonymous 2012-01-10 9:32

>>38
2deep4u

Name: Anonymous 2012-01-10 20:29

Control.Comonad.Cofree

Don't change these.
Name: Email:
Entire Thread Thread List