These are chat archives for ThoughtWorksInc/Binding.scala

28th
Mar 2017
杨博 (Yang Bo)
@Atry
Mar 28 2017 10:17
diamond-case is not a problem in Binding.scala. I don't know why he said that

Also Binding.scala's Monad implementation is pure functional, does not break monad law.

On the other hand, I know Scala.rx are Monix's Observable are impure.

@fdietze FYI
In Binding.scala, everything does not have side effects, until you call watch or dom.render.
Felix Dietze
@fdietze
Mar 28 2017 10:22
thank you. Now it's interesting if there is a misunderstanding or a mistake
@OlivierBlanvillain What do you think?
Olivier Blanvillain
@OlivierBlanvillain
Mar 28 2017 10:28

In Binding.scala, everything does not have side effects

I'm I right saying this excludes the Var#:= and the analogous methods on Vars?

杨博 (Yang Bo)
@Atry
Mar 28 2017 10:29
Ah, I mean monod methods
Olivier Blanvillain
@OlivierBlanvillain
Mar 28 2017 10:30
Interpreter pattern ftw :D
杨博 (Yang Bo)
@Atry
Mar 28 2017 10:30
I should say every monad method like map/flatMap does not have side effects, until ...
Olivier Blanvillain
@OlivierBlanvillain
Mar 28 2017 10:30
:+1:
杨博 (Yang Bo)
@Atry
Mar 28 2017 10:31
Of course watch and := performs side effects.
Olivier Blanvillain
@OlivierBlanvillain
Mar 28 2017 10:45
BTW @Atry we had an interesting discussion about the need for a diff/path mechanism, I think this comment is a good summary, I would be interested in hearing your opinion on this chess board example.
杨博 (Yang Bo)
@Atry
Mar 28 2017 10:49
I thought you could switch to Binding.scala as the underlying data-structure. I am happy to extract a core library without macros and Scalaz
@OlivierBlanvillain How do you think about that?
Binding.scala does not require imperative style, you can find higher-kinded methods on BindingSeq.
Olivier Blanvillain
@OlivierBlanvillain
Mar 28 2017 10:52
@Atry I'm not sure mhtml could be build on top of binding data-structures anymore, we now have a lot more primitive operation in addition to map, flatMap, in particular a foldp à la Elm which is quite powerful
杨博 (Yang Bo)
@Atry
Mar 28 2017 11:01
Binding.scala will not implement foldp because it yields different results at different time, for the same data source.
foldpwill break the fundamental of data-binding
And foldp breaks Applicative law on diamond-dependency because you must explicit choose one branch to be evaluated first.
Olivier Blanvillain
@OlivierBlanvillain
Mar 28 2017 11:12
Applicative do not commute so I think that's fine