Women in Technology

Hear us Roar



Article:
  An Introduction to Haskell, Part 1: Why Haskell
Subject:   Slightly simplier Ruby example
Date:   2007-05-29 09:23:10
From:   wiremine
The Ruby example can be simplified a bit using a Range object instead of an Array:


(1..10).reject {|i| i % 2 == 1}


Nice article, btw.

Full Threads Newest First

Showing messages 1 through 1 of 1.

  • Slightly simplier Ruby example
    2007-05-29 17:04:16  eydaimon [View]

    (1..10).select { |i| i % 2 == 0 }

    also works. I've only dabbled in OCaml which also has currying. It's also more modern with OOP, but it has side-effects which from what I understand, Haskell does not have.