Skip to content
This repository has been archived by the owner on Nov 30, 2022. It is now read-only.

Composing Tweaks #95

Open
michalrus opened this issue Nov 7, 2016 · 2 comments
Open

Composing Tweaks #95

michalrus opened this issue Nov 7, 2016 · 2 comments

Comments

@michalrus
Copy link

michalrus commented Nov 7, 2016

Something like that should be possible:

Tweak[SomeView](v 
  v.subView1 <~ someTweak ~
  v.subView2 <~ someOtherTweak
)

… without any notion of Ui.

Currently, we have to do:

Tweak[SomeView](v 
  (
    v.subView1 <~ someTweak ~
    v.subView2 <~ someOtherTweak
  ).get
)
@javipacheco
Copy link
Collaborator

I like that, but I think that it's not easy. We should look for the better way for that

Now, we are using Unitin our f method

case class Tweak[-W <: View](f: W  Unit) {
   def apply(w: W) = Ui(f(w))
   ...
}

Do you have any idea about how we can implement that?

Thanks!!

@michalrus
Copy link
Author

michalrus commented Nov 13, 2016

I don’t know, really. Maybe adding another .apply to the companion object. But, again it would take a Function1, type parameters of which are erased. I don't know. ¯\_(ツ)_/¯

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants