Skip to content

Commit

Permalink
footnote
Browse files Browse the repository at this point in the history
  • Loading branch information
pgujjula committed Apr 5, 2024
1 parent a14e17b commit 7d1bcf8
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down

0 comments on commit 7d1bcf8

Please sign in to comment.