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
%%% Prime number sieve code with lazy evaluation by Joe Armstrong | |
%%% (very slightly modified for syntax check) | |
%%% http://erlang.org/pipermail/erlang-questions/1999-March/000176.html | |
-module(p3). | |
-export([from/1,filter/2,sift/2,sieve/1,primes/0, first/1]). | |
%% This generates a lazy sequence starting from K. | |
%% from(K) -> |