Created
November 25, 2015 16:19
-
-
Save mlankenau/77e10eb3dcce210ecc36 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
prims = Stream.unfold({2, []}, fn {next, list} -> if(Enum.any?(list, &(rem(next, &1) == 0)), do: {nil, {next+1, list}}, else: {next, {next+1, [next|list]}}) end) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment