Skip to content
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: the function reactimate is API-incompatible #454

Open
ivanperez-keera opened this issue Nov 3, 2024 · 7 comments · May be fixed by #459
Open

bearriver: the function reactimate is API-incompatible #454

ivanperez-keera opened this issue Nov 3, 2024 · 7 comments · May be fixed by #459

Comments

@ivanperez-keera
Copy link
Owner

The function reactimate doesn't have the same signature as in Yampa: in bearriver it forces the monad of the SF to be the same as the monad of the sensing/actimation actions and reactimate itself, but a Yampa SF is mapped to a Bearriver SF on the Identity monad.

This makes modules that use Yampa's reactimate not API-compatible with bearriver.

Bearriver's FRP.Yampa module should hide FRP.BearRiver.reactimate and define one in FRP.Yampa that has the same signature as Yampa's (likely relying on FRP.BearRiver.reactimate via a qualified import).

@ivanperez-keera
Copy link
Owner Author

If someone wants to do this, please go ahead and send a PR.

Please create 2 commits:

Please check out the recent history of this repository to see how we normally document commits, and how we link commits to issues in the subject line of the commit messages. Make sure you use Refs <#issuenumber> in the summary line, etc. I like being very regular and explicit with commit messages.

There was a similar issue with embed recently. The following two commits may help understand how to best document the changes and write the commit messages:

b23a4fe
9210f04

@solomon-b
Copy link
Contributor

I'm trying to implement this with morphS and running into some trouble.

BR.reactimate senseI sense actuate (_ sf)

This hole is SF a b -> BR.SF m a b. So we need to write this:

    foldIdentity :: Monad m => SF a b -> BR.SF m a b
    foldIdentity = morphS $ pure . _ . MSF.runReader

But now I need (DTime -> c) -> c and have no obvious way to produce a DTime.

@ivanperez-keera
Copy link
Owner Author

I think the clue is:

foldIdentity :: Monad m => SF a b -> BR.SF m a b
foldIdentity = morphS $ mapReaderT $ return . runIdentity

@ivanperez-keera
Copy link
Owner Author

Hi @solomon-b . Did you get a chance to try this idea?

@solomon-b
Copy link
Contributor

Not yet, but I plan to work on it this weekend.

@ivanperez-keera
Copy link
Owner Author

Hi @solomon-b . Let me know if you want me to take a look at something, even if it's not complete. Thanks!

@solomon-b
Copy link
Contributor

@ivanperez-keera I'm sorry for the delay. Work got really busy but I have time this weekend (for real this time). I'll get something together by end of day tomorrow.

@solomon-b solomon-b linked a pull request Dec 2, 2024 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants