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

Pages: 1-

Time for Haskell-bashing

Name: Anonymous 2012-10-02 22:44

Lisp

progn (f1 x1 y1 z1) (f2 0 -1 0) (f3 x2 y2 z2) (f4 0 1 0) (f5 "Done.")


Haskell

do f1 x1 y1 z1 f2 0 (-1) 0 f3 x2 y2 z2 f4 0 1 0 f5 "Done."
f1 x1 y1 z1 >> f2 0 (-1) 0 >> f3 x2 y2 z2 >> f4 0 1 0 >> f5 "Done."
do { f1 x1 y1 z1; f2 0 (-1) 0; f3 x2 y2 z2; f4 0 1 0; f5 "Done." }

Name: Anonymous 2012-10-02 22:55

>>1
I'm sure you can write anti-idiomatic Lisp, too.
It'd probably even make it look better!

Name: Anonymous 2012-10-02 23:00

>>2
Lisp is orthogonal, Haskell isn't.

Name: Anonymous 2012-10-02 23:07

>>3
(+ 2 2 2)
(* 2 3)
Where is your orthogonal now?

Name: Anonymous 2012-10-02 23:20

>>4
wut?

Name: Anonymous 2012-10-02 23:25

>>5
An instruction set is said to be orthogonal if it lacks redundancy (i.e. there is only a single instruction that can be used to accomplish a given task)

Name: Anonymous 2012-10-02 23:29

>>6
so?

Name: Anonymous 2012-10-02 23:33

>>6
PYTHON IS ORTHOGONAL; THERE IS ONLY ONE WAY TO DO IT

Name: Anonymous 2012-10-02 23:34

>>8
Compared to Haskell or Perl.

Name: Anonymous 2012-10-02 23:37

>>7
See >>4. There are clearly at least two ways to do it.

Name: Anonymous 2012-10-03 0:14

>>10
multiplication is faster than addition. so no.

Name: Anonymous 2012-10-03 0:19

>>11
That's a piss poor excuse.

Name: Anonymous 2012-10-03 1:09

>>12
speed excuses even C/C++

Name: Anonymous 2012-10-03 1:13

>>13
No, it's a piss poor excuse in the face of this orthogonality argument. That has nothing to do with how dirty you think C happens to be.

Name: Anonymous 2012-10-03 1:14

>>14
How?

Name: Anonymous 2012-10-03 1:17

>>15
Were we ever discussing C thus far? And I never claimed C was orthogonal anyways. In fact you just abruptly brought it up. And even had the indecency to use ``C/C++''.

Name: Anonymous 2012-10-03 1:26

wow OP. you discovered haskell is a research language, designed for academics to write papers about. It's used in two programs, some bank software in new zealand and xmonad. the future is javascript

Name: Anonymous 2012-10-03 1:27

>>17
You actually had me until "the future is javascript". But now I have to disagree horribly. I'd take Haskell over that broke piece of shit any day.

Name: Anonymous 2012-10-03 1:28

>>16
every language includes both + and -

Name: Anonymous 2012-10-03 1:29

>>18
He must be reading too many dystopian novels!

Name: Anonymous 2012-10-03 4:57

>>10
They both optimise to a constant. It wouldn't work with an unknown valu--IHBT

Name: Anonymous 2012-10-03 5:31

Common Lisp
(defun vector-length (seq)
  (sqrt (reduce #'+ (map 'vector #'(lambda (x) (* x x)) seq) :from-end t)))

VECTOR-LENGTH

Haskell
let vecLen = sqrt . Data.Foldable.sum
    Ambiguous type variable `t0' in the constraint:
      (Foldable t0) arising from a use of `Data.Foldable.sum'
    Probable fix: add a type signature that fixes these type variable(s)
    In the second argument of `(.)', namely `Data.Foldable.sum'
    In the expression: sqrt . Data.Foldable.sum
    In an equation for `vecLen': vecLen = sqrt . Data.Foldable.sum

Name: Anonymous 2012-10-03 5:36

Better Common Lisp
(defun vector-length (seq)
  (sqrt (reduce #'(lambda (a x) (+ a (* x x))) seq :from-end t :initial-value 0)))

Name: 23 2012-10-03 5:38

fuck i inverted a and x

Name: Anonymous 2012-10-03 8:40


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