Skip to content
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’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add cached function to bolts #97

Merged
merged 1 commit into from
Aug 5, 2024

Conversation

samuelchassot
Copy link
Contributor

No description provided.

@vkuncak
Copy link
Contributor

vkuncak commented Aug 5, 2024

Can we make cache field private:

final case class CachedFunction[I, O](
    f: I => O,
    hashable: Hashable[I],
    private cache: MutableHashMap.HashMap[I, O]
) 

and move these requires to the apply, because we have some issues with require on constructors?

  @opaque
  def apply(x: I): O = {
    require(cache.valid)
    require(CachedFunction.allValuesAreFunctionOutputs(f, cache))

@vkuncak vkuncak merged commit 93a551b into epfl-lara:main Aug 5, 2024
@samuelchassot
Copy link
Contributor Author

samuelchassot commented Aug 5, 2024

Indeed, good points! Here is another PR #98

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants