-
Notifications
You must be signed in to change notification settings - Fork 273
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fixes primus self seeding generators (#964)
* memoizes values read from Primus memory layers Memoizes values produced by static or dynamic layers, so that two consequent reads will yield the same value. * fixes Primus generators Due to a design error, Primus self-seeding generators never worked as expected, as they were recreating themselves on each access. The problem is more a design error, rather than implementation, therefore the fix is not very beatiful. It is really hard to implement correctly the `create init` function which has `(int -> t) -> t` type. The proposed implementation allows only such init that forall `x, y : int`, `init x` and `init y` generate generators of the same type. Probably, there is a better solution (by making the Generator type a Primus component and turning them into higher-order functions), but since we dropped generators in Primus 2.0 (in favor of a much easier to use mechanism), I don't think that it is worthwhile to spend more time on the current implementation. * updates docs and error messages
- Loading branch information
Showing
3 changed files
with
118 additions
and
43 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters