Skip to content

Instantly share code, notes, and snippets.

@GoNZooo
Last active August 29, 2015 14:18
Show Gist options
  • Save GoNZooo/c3d5853e9eab511eb4cd to your computer and use it in GitHub Desktop.
Save GoNZooo/c3d5853e9eab511eb4cd to your computer and use it in GitHub Desktop.
defmodule Pmap do
def pmap(lst, func) do
Enum.map(lst, fn i -> Task.async(fn -> func.(i) end) end)
|> Enum.map(fn t -> Task.await(t) end)
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment