News for hackers. Stuff that matters.
Re:Why Haskell? by itishappy on Thursday September 12, 2024 @09:35AM (#41520775)
Don't Haskell and Python use the same argument order?

    filter(lambda x: x<5, map(lambda x: 2*x, [1,2,3,4,5]))

    filter (<5) . map (*2) $ [1,2,3,4,5]
(Technically the Python version should be cast to a list to have identical behavior.)

Same with comprehensions (although nesting comprehensions will always get weird).

    [x for x in [2*x for x in [1,2,3,4,5]] if x<5]

    [x | x <- [2*x | x <- [1,2,3,4,5]], x<5]

There are no comments on this comment yet.