-
Notifications
You must be signed in to change notification settings - Fork 30
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
bearriver: base bearriver and Rhine's SyncSF on the same footing #70
Comments
Question: How would we call the fundamental building block, i.e. an |
One way to rephrase this is the following: Bearriver is two things:
I think these are two different aspects, and I want to separate them more clearly. I want to use 1. for rhine, without having 2. |
One possible name is |
@ivanperez-keera, such a package might be the right place to put your time transformation ideas, self-clocked |
I think it's a better idea not to create a separate package for this, but just to make this a module in dunai. |
While this might be an improvement in same ways, it also adds yet another level of indirection to understand, explain or work on Bearriver. Once I become more familiar with rhine, maybe this will bug me enough or I'll decide to factorize stuff. In the meantime, it doesn't. So, if there's some duplication between rhine and bearriver, there will have to be. |
@ivanperez-keera Is #174 enough to revisit this issue here? |
Not as such, or not based on what I understand currently. I've been giving talks about Dunai, Bearriver and Rhine. I would not find it easier to describe if we add additional layers, and I think, in the long run, it's going to be much better for the project as a whole that beginners find a really, really low entry barrier to understand the concepts described. Additionally, I'm currently trying to reduce the burden of maintaining all of this work, and this would not make it immediately easier for me. My current focus atm. is on cleaning all of this and documenting it well. Right now, I cannot answer off the top of my head what is in dunai and where it is defined, and that really, really bugs me because I simply cannot understand the impact that other changes will have, or other improvements we could bring to all of these libraries. |
Makes sense. In that case, I'd recommend duplicating the code from Rhine's monad handling to Bearriver. Would you like a PR doing that? |
It seems like there is a lot of code duplication between bearriver and Rhine's
SyncSF
s. The basic idea is the same in both cases: Add an outermostReaderT TimeDiff
layer toMSF
s which represents the time difference since the last tick.I'm proposing to find a common basis to both in order to avoid code duplication.
Duplicated code
Already present
Where we could merge code from one to the other
rhine -> bearriver
: Exception handlingbearriver -> rhine
: Random number generationWhere we could avoid duplication in the future
SF
s. (See this issue.)Proposal
TimeDiff
to capture the essence that is needed.integral
etc. to work both for Rhine and bearriver.bearriver
into a thin wrapper that does nothing else than just recreating the Yampa API.Advantages
Disadvantages
SyncSF
s aren't justMSF (ReaderT TimeDiff m) a b
, but actuallyMSF (ReaderT TimeInfo m) a b
, whereTimeInfo
holds the time delta since the last tick, and the beginning of the program, and the absolute time (e.g.UTCTime
).The text was updated successfully, but these errors were encountered: