Skip to content

Commit

Permalink
Implement pairs
Browse files Browse the repository at this point in the history
  • Loading branch information
tomstuart committed Oct 28, 2011
1 parent 1b6b8df commit e80e1a1
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
6 changes: 3 additions & 3 deletions lib/nothing.rb
Expand Up @@ -44,9 +44,9 @@ module Nothing

# Pairs

# PAIR =
# LEFT =
# RIGHT =
PAIR = -> x { -> y { -> f { f[x][y] } } }
LEFT = -> p { p[-> x { -> y { x } } ] }
RIGHT = -> p { p[-> x { -> y { y } } ] }

# Lists

Expand Down
6 changes: 3 additions & 3 deletions spec/nothing_spec.rb
Expand Up @@ -64,13 +64,13 @@
end

describe 'pairs' do
specify { pending { PAIR[representation_of 3][representation_of 5].should represent Pair.new(3, 5) } }
specify { PAIR[representation_of 3][representation_of 5].should represent Pair.new(3, 5) }

let(:foo) { Object.new }
let(:bar) { Object.new }

specify { pending { LEFT[PAIR[foo][bar]].should equal(foo) } }
specify { pending { RIGHT[PAIR[foo][bar]].should equal(bar) } }
specify { LEFT[PAIR[foo][bar]].should equal(foo) }
specify { RIGHT[PAIR[foo][bar]].should equal(bar) }
end

describe 'lists' do
Expand Down

0 comments on commit e80e1a1

Please sign in to comment.