Skip to content

Instantly share code, notes, and snippets.

@Veejay
Created April 20, 2012 15:52
Show Gist options
  • Save Veejay/2429854 to your computer and use it in GitHub Desktop.
Save Veejay/2429854 to your computer and use it in GitHub Desktop.
def pmap &block
if size > 0
match self.shape,
head_tail: ->{ self.tail.pmap(&block).unshift yield(self.head) },
head: ->{ [ yield(self.head) ] }
else
self
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment