four in ruby and haskell