New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We鈥檒l occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add memoize
#1138
Comments
Again - what bounds do we define for |
@raveclassic I agree - a consistent guide/standard for placing new features/shaping API is very desirable. On the other hand, I am pretty sure memoization should live in the very core of any functional library - as I said, I would welcome including it in the language itself ;) (yeah, it's not gonna happen, but imagine e.g. |
When we introduce memoization we should always think of the following questions:
All these question are too specific for such an abstract library like |
@raveclassic Fair point, let's see what @gcanti thinks about it. Just for transparency, I usually implement cache as simple |
Personally I see fp-ts as a lib that implements the theories (category, abstract algebra, etc). with some common usage implementations. Caching is a huge subject onto its own - notoriously difficult. Personally I see little reason why it should be tied into fp-ts itself. Another example would be immutability. So maybe an ecosystem lib that provides this functionality as a configurable opt-in (like @ngrx does re immutability) would be the best solution. |
Ideally an (fp-ts) API should have a single, obvious implementation. |
馃殌 Feature request
Add helper for memoization:
Desired Behavior
It would be nice if memoization was included in
fp-ts
. It's such a fundamental concept in functional programming I nearly regret it's not shipped with the language itself ;) I would also appreciatefp-ts
being self-contained, battery included package for functional programming, without need to install Ramda/lodash or writing own helpers for such a basic feature.Suggested Solution
If this is approved, I can open a PR on that
Who does this impact? Who is this for?
All users of pure but costly functions ;)
Your environment
The text was updated successfully, but these errors were encountered: