From 7d1bcf84fd4731a39342ddcf436264698228f0bb Mon Sep 17 00:00:00 2001 From: Preetham Gujjula Date: Thu, 4 Apr 2024 18:22:41 -0700 Subject: [PATCH] footnote --- README.md | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 1b839c8..904a7d3 100644 --- a/README.md +++ b/README.md @@ -20,6 +20,17 @@ a sorted list of all `f x y`, for each `x` in `xs` and `y` in `ys`. With `applyMerge`, we can implement a variety of complex algorithms succinctly. For example, the Sieve of Erastosthenes[^1] to generate prime numbers: + +[^1]: Note that this is really the Sieve of Erastosthenes, as defined in the +classic [The Genuine Sieve of Eratosthenes](https://www.cs.hmc.edu/~oneill/papers/Sieve-JFP.pdf). +Constrast this to other simple prime generation implementations, such as +``` +primes = sieve [2..] +sieve (p : xs) = p : sieve [x | x <− xs, x ‘mod‘ p > 0] +``` +which is actually trial division, and not a faithful implementation of the Sieve +of Erastosthenes. + ```haskell primes :: [Int] primes = 2 : ([3..] `minus` composites) -- `minus` from data-ordlist @@ -44,7 +55,6 @@ overwritten. See [ALGORITHM.md](docs/ALGORITHM.md) for a full description of the algorithm. -[^1]: (Note that this is really the Sieve of Erastosthenes, as defined in the classic [The Genuine Sieve of Eratosthenes](https://www.cs.hmc.edu/~oneill/papers/Sieve-JFP.pdf), and not trial division). ## Licensing This project licensed under BSD-3-Clause (except for `.gitignore`, which is