Skip to content

Conversation

@lehins
Copy link
Contributor

@lehins lehins commented Jan 28, 2021

I don't know why I haven't thought of this before, but here is a mutable generator that works in STM: TGenM that is based on a TVar

@lehins lehins changed the title WIP: Implementation of STMGenM WIP: Implementation of TGenM for stm Jun 6, 2021
@lehins lehins changed the title WIP: Implementation of TGenM for stm Implementation of TGenM for STM Sep 6, 2021
@lehins lehins force-pushed the tvar-stm branch 2 times, most recently from 536bf56 to 62055d2 Compare September 8, 2021 01:41
@lehins
Copy link
Contributor Author

lehins commented Sep 11, 2021

Anyone feels like reviewing this PR? If not, I'll merge it over the weekend and make it part of the upcoming release #110

Copy link
Contributor

@Shimuuar Shimuuar left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good. It adds dependency on STM but since it's de facto part of stanadrd library it's not a problem.

I thought it could cause problems for STM if its test suite depends on random and thus becomes nonbuildable. But it turns out stm does not have one, at least in cabal file

@lehins
Copy link
Contributor Author

lehins commented Sep 11, 2021

It adds dependency on STM but since it's de facto part of stanadrd library it's not a problem.

Actually only the test suite depends on stm. The implementation itself imports TVar directly from base: import GHC.Conc.Sync:
https://github.com/haskell/random/pull/95/files#diff-2c181ac3f73b5e3eadd5b0019d00d2a54ecbcc244a8d583a8d2aeb1cad97eda1R110

@lehins lehins merged commit a390fde into master Sep 12, 2021
@lehins lehins deleted the tvar-stm branch September 12, 2021 01:49
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.

3 participants