{"width":"100%","categories":["elixir"],"author_name":"sinsoku","version":"1.0","provider_url":"https://hatena.blog","description":"\u30bf\u30a4\u30c8\u30eb\u306e\u901a\u308a\u3001 Sleep Sort \u3092\u5b9f\u88c5\u3057\u3066\u307f\u307e\u3057\u305f\u3002 Elixir \u306e\u4e26\u884c\u30d7\u30ed\u30b0\u30e9\u30df\u30f3\u30b0\u3092\u751f\u304b\u3057\u3066\u3044\u308b\u3051\u3069\u3001\u5168\u304f\u5b9f\u7528\u7684\u3058\u3083\u306a\u3044\u30bd\u30fc\u30c8\u3067\u3059\u306d\uff01 defmodule SleepSort do def sort(collection) do me = self collection |> Enum.map(fn (n) -> spawn_link fn -> (send me, { :timer.sleep(n * 10) && n }) end end) |> Enum.map(fn (_pid) -> receive do { result } -> result end end) en\u2026","blog_url":"https://sinsoku.hatenablog.com/","published":"2016-11-13 22:50:19","image_url":null,"blog_title":"\u30a2\u30b8\u30e3\u30a4\u30ebSE\u306e\u6182\u9b31","title":"Elixir \u3067 Sleep Sort \u3092\u5b9f\u88c5\u3059\u308b","author_url":"https://blog.hatena.ne.jp/sinsoku/","url":"https://sinsoku.hatenablog.com/entry/2016/11/13/225019","height":"190","html":"<iframe src=\"https://hatenablog-parts.com/embed?url=https%3A%2F%2Fsinsoku.hatenablog.com%2Fentry%2F2016%2F11%2F13%2F225019\" title=\"Elixir \u3067 Sleep Sort \u3092\u5b9f\u88c5\u3059\u308b - \u30a2\u30b8\u30e3\u30a4\u30ebSE\u306e\u6182\u9b31\" class=\"embed-card embed-blogcard\" scrolling=\"no\" frameborder=\"0\" style=\"display: block; width: 100%; height: 190px; max-width: 500px; margin: 10px 0px;\"></iframe>","provider_name":"Hatena Blog","type":"rich"}