Replies: 12 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). |
Beta Was this translation helpful? Give feedback.
-
Of course, the more tests and benchmarks we have, the better. |
Beta Was this translation helpful? Give feedback.
-
Yes.
Yes. I have been able to replace references to, say,
Yes. |
Beta Was this translation helpful? Give feedback.
-
What would be the signatures of:
|
Beta Was this translation helpful? Give feedback.
-
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 |
Beta Was this translation helpful? Give feedback.
-
That I don't understand/agree with. Even if @Linearity Or what exactly do you mean by "state handling"? |
Beta Was this translation helpful? Give feedback.
-
@Linearity apologies, I confused In This approach is simple because most monad transformers commute with |
Beta Was this translation helpful? Give feedback.
-
@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 |
Beta Was this translation helpful? Give feedback.
-
@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. |
Beta Was this translation helpful? Give feedback.
-
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. |
Beta Was this translation helpful? Give feedback.
-
Meaning, you can |
Beta Was this translation helpful? Give feedback.
-
My takeaway from this issue is that we need the analogous functionality like the |
Beta Was this translation helpful? Give feedback.
-
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.Beta Was this translation helpful? Give feedback.
All reactions