Monadic parsing in Ruby