Skip to content

Commit

Permalink
Update README
Browse files Browse the repository at this point in the history
  • Loading branch information
pgujjula committed Apr 5, 2024
1 parent b5423cd commit 83f2d88
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ smooth3 = applyMerge (*) (iterate (*2) 1) (iterate (*3) 1)
```

Gaussian integers, ordered by norm ([Wikipedia](https://en.wikipedia.org/wiki/Gaussian_integer)):

```haskell
zs :: [Int]
zs = 0 : concatMap (\i -> [i, -i]) [1..]
Expand All @@ -64,13 +65,20 @@ squarefrees = [1..] `minus` applyMerge (*) (map (^2) primes) [1..]
```

## Naming
The name `applyMerge` comes from the idea of applying `f` to each `x` and `y`, and merging the results into one sorted output. I'm still thinking of the ideal name for this function. Other options include `sortedLiftA2`/`orderedLiftA2`, from the idea that this function is equivalent to `sort (liftA2 f xs ys)` when `xs` and `ys` are finite. If you have any ideas on the naming, let me know!

The name `applyMerge` comes from the idea of applying `f` to each `x` and `y`,
and merging the results into one sorted output. I'm still thinking of the ideal
name for this function. Other options include `sortedLiftA2`/`orderedLiftA2`,
from the idea that this function is equivalent to `sort (liftA2 f xs ys)` when
`xs` and `ys` are finite. If you have any ideas on the naming, let me know!

## Further reading

See [ALGORITHM.md](docs/ALGORITHM.md) for a full exposition of the `applyMerge` function and its implementation.
See [ALGORITHM.md](docs/ALGORITHM.md) for a full exposition of the `applyMerge`
function and its implementation.

## Licensing

This project licensed under BSD-3-Clause (except for `.gitignore`, which is
under CC0-1.0), and follows [REUSE](https://reuse.software) licensing
principles.
Expand Down

0 comments on commit 83f2d88

Please sign in to comment.