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

Seamless combination of RVs and Rules with ReaderT r IO #4

Open
ivanperez-keera opened this issue Sep 6, 2017 · 0 comments
Open

Seamless combination of RVs and Rules with ReaderT r IO #4

ivanperez-keera opened this issue Sep 6, 2017 · 0 comments

Comments

@ivanperez-keera
Copy link
Contributor

ivanperez-keera commented Sep 6, 2017

The following construction is very common:

installRule cenv = do
  f <- someFieldOfAnUIElement <$> someUIElement (uiBuilder (view cenv))
  let f2 - someFieldOfTheModel (model cenv))

 f =:= f2

The cenv is being passed around. Ideally, we'd want to write:

installRule =
  (someFieldOfAnUIElement . someUIElement) =:= someFieldOfTheModel

An initial approximation would be possible if we make RVs and RRs run on a reader monad with cenv in the environment. Some additional modifications would be necessary to make model and uiBuilder.view somehow implicit, and to make the (<$>) go away.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

No branches or pull requests

1 participant