Skip to content

Commit

Permalink
Bump version.
Browse files Browse the repository at this point in the history
  • Loading branch information
Simon Harris committed Jan 17, 2010
1 parent 8d71844 commit d615111
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 3 deletions.
13 changes: 13 additions & 0 deletions History.rdoc
Original file line number Diff line number Diff line change
@@ -1,3 +1,16 @@
=== 0.2.3 / 2010-01-18

* Implement Set#group_by.

* Implement List#group_by.

* Implement Hash#inspect.

* Tuples can now be implicitly converted to args and variables via #to_ary, meaning you can do:

integers = Hamster.iterate(1, &:succ)
odds, evens = integers.partition(&:odd?)

=== 0.2.2 / 2010-01-15

* Implement List#flatten.
Expand Down
9 changes: 7 additions & 2 deletions README.rdoc
Original file line number Diff line number Diff line change
Expand Up @@ -128,13 +128,18 @@ Besides <tt>Hamster.list</tt> there are other ways to construct lists:

<tt>Hamster.interval(from, to)</tt> (aliased as <tt>.range</tt>) creates a lazy list equivalent to a list containing all the values between <tt>from</tt> and <tt>to</tt> without actually creating a list that big.

<tt>Hamster.stream { ... }</tt> allows you to creates infinite lists. Each time a new value is required, the supplied block is called.
<tt>Hamster.stream { ... }</tt> allows you to creates infinite lists. Each time a new value is required, the supplied block is called. For example, to generate a list of integers you could do:

count = 1
integers = Hamster.stream { count += 1 }

<tt>Hamster.repeat(x)</tt> creates an infinite list with x the value for every element.

<tt>Hamster.replicate(n, x)</tt> creates a list of size n with x the value for every element.

<tt>Hamster.iterate(x) { ... }</tt> creates an infinite list where the first item is calculated by applying the block on the initial argument, the second item by applying the function on the previous result and so on.
<tt>Hamster.iterate(x) { ... }</tt> creates an infinite list where the first item is calculated by applying the block on the initial argument, the second item by applying the function on the previous result and so on. For example, a simpler way to generate a list of integers would be:

integers = Hamster.iterate(1, &:succ)

You also get <tt>Enumerable#to_list</tt> so you can slowly transition from built-in collection classes to Hamster.

Expand Down
2 changes: 1 addition & 1 deletion lib/hamster/version.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
module Hamster

VERSION = "0.2.2".freeze
VERSION = "0.2.3".freeze

end

0 comments on commit d615111

Please sign in to comment.