-
Notifications
You must be signed in to change notification settings - Fork 36
This issue was moved to a discussion.
You can continue the conversation there. Go to discussion →
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
: Cannot apply runStateS__
to SF (StateT s m) a b
values
#174
Comments
So, from what I understand:
This would require a fair amount of work, especially after 54e81ab. Is that correct? @turion Opinions? @Linearity I probably would not want to immediately put in the work, but I'm open to accepting a patch (I'd suggest that we all agree here first, otherwise the work might be for nothing). |
Of course, the more tests and benchmarks we have, the better. |
Yes.
Yes. I have been able to replace references to, say,
Yes. |
What would be the signatures of:
|
Everything else (at least) compiles with minimal changes. The monad in reactimate is not the same for the sensing actions and the SF. For FRP.Yampa, those three functions could be specialized for |
That I don't understand/agree with. Even if @Linearity Or what exactly do you mean by "state handling"? |
@Linearity apologies, I confused In This approach is simple because most monad transformers commute with |
@ivanperez-keera Yes, I imagined that @turion I think you're right, I was mistaken. If I were happy with
This is the real issue, yes. If I understand them correctly, the functions you referred to in Rhine can transform a monadic stream function of type
into one of type
Is that correct? Could BearRiver include such a facility as well? If so then I could run my |
@Linearity Yes, that is about correct. BearRiver could include pretty much the same code like Rhine does. Simply replace This issue here is actually one of the reasons I opened #70 in order to avoid that duplication. Maybe it's time to revisit. |
SF
does not use MonadReader
runStateS
- functions to SF (StateT s m) a b
values
runStateS
- functions to SF (StateT s m) a b
valuesrunStateS__
to SF (StateT s m) a b
values
I'm not really following the detour that this conversation took. Also, I do not see why "the entirety of the composite signal function could use only one state type for everything" holds. |
Meaning, you can |
My takeaway from this issue is that we need the analogous functionality like the |
runStateS__
to SF (StateT s m) a b
valuesbearriver
: Cannot apply runStateS__
to SF (StateT s m) a b
values
This issue was moved to a discussion.
You can continue the conversation there. Go to discussion →
BearRiver represents signal functions with a type that is polymorphic in the monad defining the type of the underlying monadic stream function, namely
This is nice because it offers users the opportunity to incorporate other monadic effects. But like many applications of monad transformers it forces one particular transformer,
ReaderT DTime
, to be at the top of whatever transformer stack you might want to use. That means that one must uselift
to incorporate, say, state handling in signal functions.If it instead used a
MonadReader DTime m
constraint in the style of the "mtl" package, it could be more flexible. There is a demand for this flexibility. Is this a reasonable thing to do in BearRiver?The actual type synonym
SF
could not be defined this way, but the primitive signal functions could be. For instance, the type ofedge
could be:Then it would be easy to use
edge
in a signal function whose monad hasStateT
at the top. This would be nice, because then we could applyrunStateS__
before passing the result toreactimate
, which naturally appliesrunReaderS
. As it stands, I believe, we must applyrunStateS__
afterreactimate
, meaning that the entirety of the composite signal function could use only one state type for everything. That is a tremendous limitation, and it seems relatively straightforward to remove.The text was updated successfully, but these errors were encountered: