Skip to content

Commit

Permalink
documentatino update
Browse files Browse the repository at this point in the history
  • Loading branch information
hunkyjimpjorps committed Apr 19, 2024
1 parent 19b1dd9 commit 78a3be5
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
9 changes: 5 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,16 @@
[![Package Version](https://img.shields.io/hexpm/v/rememo)](https://hex.pm/packages/rememo)
[![Hex Docs](https://img.shields.io/badge/hex-docs-ffaff3)](https://hexdocs.pm/rememo/)

This is a basic memoization method for Gleam on the Erlang target, using an actor to cache and reuse the results of function calls when possible.
This is a basic [memoization](https://en.wikipedia.org/wiki/Memoization) method for Gleam on the Erlang target, for caching and reusing the results of function calls when possible.

There is some overhead to sending messages and caching the dictionary of results, but in situations that call for it, like dynamic programming problems where the same basic subproblem recurs hundreds or thousands of times, the tradeoff is worthwhile. Always benchmark your code when in doubt.
Adding to and reading from the memoization cache incurs some overhead, but in situations that call for it, like dynamic programming problems where the same basic subproblem recurs hundreds or thousands of times, the tradeoff is worthwhile. Always benchmark your code when in doubt.

```sh
gleam add rememo
```

```gleam
import memo/ets/memo // This is the recommended implementation to use
import rememo/ets/memo // This is the recommended implementation to use
import gleam/io
pub fn main() {
Expand All @@ -37,4 +38,4 @@ Further documentation can be found at <https://hexdocs.pm/rememo>.

## Contributing and development

Suggestions and pull requests are welcome.
Suggestions and pull requests are welcome.
2 changes: 1 addition & 1 deletion gleam.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ version = "2.0.0"
# Fill out these fields if you intend to generate HTML documentation or publish
# your project to the Hex package manager.
#
description = "Simple OTP-based memoization for Gleam"
description = "Simple memoization for Gleam"
licences = ["Apache-2.0"]
target = "erlang"
repository = { type = "github", user = "hunkyjimpjorps", repo = "rememo" }
Expand Down

0 comments on commit 78a3be5

Please sign in to comment.