Quantcast

Any examples of pure functional Scala.js GUIs?

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
14 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Any examples of pure functional Scala.js GUIs?

William Harvey
Hi Everyone,

I am interested in building a Scala.js frontend for a web application that is written in a pure functional style.  Specifically, I would like to try to see how much mileage I can get out of the "onion architecture" proposed by John De Goes (link), but I am a bit unsure of the best practices for attaching an interpreter for the pure FP program to something like the slurry of events pouring in via DOM callbacks (inversion of control).  I have a feeling that FRP should be in the glue somewhere, but I am hoping to learn a bit from the approaches that others have taken (if anyone has even attempted this).

Does anyone have any examples of pure functional Scala.js GUIs, or any recommendations on libraries or resources that I might look into for building a pure functional Scala.js frontend?

Thank you very much!

William Harvey

--
You received this message because you are subscribed to the Google Groups "scala-user" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Any examples of pure functional Scala.js GUIs?

杨 Yang博 Bo
Have you seen Binding.scala. There is a monad-based data-binding mechanism behind its HTML template syntactic sugar.

在 2017年1月25日星期三 UTC+8下午10:50:52,William Harvey写道:
Hi Everyone,

I am interested in building a Scala.js frontend for a web application that is written in a pure functional style.  Specifically, I would like to try to see how much mileage I can get out of the "onion architecture" proposed by John De Goes (<a href="http://degoes.net/articles/modern-fp-part-2" target="_blank" rel="nofollow" onmousedown="this.href=&#39;http://www.google.com/url?q\x3dhttp%3A%2F%2Fdegoes.net%2Farticles%2Fmodern-fp-part-2\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNHa48d5mJwVakWktQB3mhbL0Vaxtg&#39;;return true;" onclick="this.href=&#39;http://www.google.com/url?q\x3dhttp%3A%2F%2Fdegoes.net%2Farticles%2Fmodern-fp-part-2\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNHa48d5mJwVakWktQB3mhbL0Vaxtg&#39;;return true;">link), but I am a bit unsure of the best practices for attaching an interpreter for the pure FP program to something like the slurry of events pouring in via DOM callbacks (inversion of control).  I have a feeling that FRP should be in the glue somewhere, but I am hoping to learn a bit from the approaches that others have taken (if anyone has even attempted this).

Does anyone have any examples of pure functional Scala.js GUIs, or any recommendations on libraries or resources that I might look into for building a pure functional Scala.js frontend?

Thank you very much!

William Harvey

--
You received this message because you are subscribed to the Google Groups "scala-user" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Any examples of pure functional Scala.js GUIs?

Naftoli Gugenheim
What about for handling clicks?

On Wed, Jan 25, 2017 at 11:48 PM 博 Bo 杨 Yang <[hidden email]> wrote:
Have you seen Binding.scala. There is a monad-based data-binding mechanism behind its HTML template syntactic sugar.

在 2017年1月25日星期三 UTC+8下午10:50:52,William Harvey写道:
Hi Everyone,

I am interested in building a Scala.js frontend for a web application that is written in a pure functional style.  Specifically, I would like to try to see how much mileage I can get out of the "onion architecture" proposed by John De Goes (link), but I am a bit unsure of the best practices for attaching an interpreter for the pure FP program to something like the slurry of events pouring in via DOM callbacks (inversion of control).  I have a feeling that FRP should be in the glue somewhere, but I am hoping to learn a bit from the approaches that others have taken (if anyone has even attempted this).

Does anyone have any examples of pure functional Scala.js GUIs, or any recommendations on libraries or resources that I might look into for building a pure functional Scala.js frontend?

Thank you very much!

William Harvey

--
You received this message because you are subscribed to the Google Groups "scala-user" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Groups "scala-user" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Any examples of pure functional Scala.js GUIs?

杨 Yang博 Bo
You can use `onAction` attribute: For example: 

import javafx.application.Application
import javafx.event.{ActionEvent, EventHandler, EventType}
import javafx.stage.{PopupWindow, Stage, Window, WindowEvent}

final class FxmlSample extends Application {
@fxml override def start(primaryStage: Stage): Unit = {
import javafx.scene.layout.VBox
import javafx.scene.control._
import javafx.scene.Scene
def newWindow(text: String) = fxml.show {
<Stage title={text}>
<scene>
<Scene>
<Label>{text}</Label>
</Scene>
</scene>
</Stage>
}
val myScene = <Scene>
<VBox>
<Button onAction={ event: ActionEvent => newWindow("Newly created window")}>New Window</Button>
</VBox>
</Scene>
fxml.show(primaryStage, myScene)
}
}
object FxmlSample {
def main(args: Array[String]): Unit = {
Application.launch(classOf[FxmlSample], args: _*)
}
}

2017-01-26 18:39 GMT+08:00 Naftoli Gugenheim <[hidden email]>:
What about for handling clicks?

On Wed, Jan 25, 2017 at 11:48 PM 博 Bo 杨 Yang <[hidden email]> wrote:
Have you seen Binding.scala. There is a monad-based data-binding mechanism behind its HTML template syntactic sugar.

在 2017年1月25日星期三 UTC+8下午10:50:52,William Harvey写道:
Hi Everyone,

I am interested in building a Scala.js frontend for a web application that is written in a pure functional style.  Specifically, I would like to try to see how much mileage I can get out of the "onion architecture" proposed by John De Goes (link), but I am a bit unsure of the best practices for attaching an interpreter for the pure FP program to something like the slurry of events pouring in via DOM callbacks (inversion of control).  I have a feeling that FRP should be in the glue somewhere, but I am hoping to learn a bit from the approaches that others have taken (if anyone has even attempted this).

Does anyone have any examples of pure functional Scala.js GUIs, or any recommendations on libraries or resources that I might look into for building a pure functional Scala.js frontend?

Thank you very much!

William Harvey

--
You received this message because you are subscribed to the Google Groups "scala-user" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.



--
杨博 (Yang Bo)

--
You received this message because you are subscribed to the Google Groups "scala-user" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Any examples of pure functional Scala.js GUIs?

杨 Yang博 Bo
In reply to this post by Naftoli Gugenheim
And for Scala.js, use onclick

在 2017年1月26日星期四 UTC+8下午6:40:10,nafg写道:
What about for handling clicks?

On Wed, Jan 25, 2017 at 11:48 PM 博 Bo 杨 Yang <<a href="javascript:" target="_blank" gdf-obfuscated-mailto="RZsLAbs0BAAJ" rel="nofollow" onmousedown="this.href=&#39;javascript:&#39;;return true;" onclick="this.href=&#39;javascript:&#39;;return true;">pop....@...> wrote:
Have you seen <a href="https://github.com/ThoughtWorksInc/Binding.scala" target="_blank" rel="nofollow" onmousedown="this.href=&#39;https://www.google.com/url?q\x3dhttps%3A%2F%2Fgithub.com%2FThoughtWorksInc%2FBinding.scala\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNEH8Woi6MbP24rN5sAF9IyqPgndUQ&#39;;return true;" onclick="this.href=&#39;https://www.google.com/url?q\x3dhttps%3A%2F%2Fgithub.com%2FThoughtWorksInc%2FBinding.scala\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNEH8Woi6MbP24rN5sAF9IyqPgndUQ&#39;;return true;">Binding.scala. There is a monad-based data-binding mechanism behind its HTML template syntactic sugar.

在 2017年1月25日星期三 UTC+8下午10:50:52,William Harvey写道:
Hi Everyone,

I am interested in building a Scala.js frontend for a web application that is written in a pure functional style.  Specifically, I would like to try to see how much mileage I can get out of the "onion architecture" proposed by John De Goes (<a href="http://degoes.net/articles/modern-fp-part-2" rel="nofollow" target="_blank" onmousedown="this.href=&#39;http://www.google.com/url?q\x3dhttp%3A%2F%2Fdegoes.net%2Farticles%2Fmodern-fp-part-2\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNHa48d5mJwVakWktQB3mhbL0Vaxtg&#39;;return true;" onclick="this.href=&#39;http://www.google.com/url?q\x3dhttp%3A%2F%2Fdegoes.net%2Farticles%2Fmodern-fp-part-2\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNHa48d5mJwVakWktQB3mhbL0Vaxtg&#39;;return true;">link), but I am a bit unsure of the best practices for attaching an interpreter for the pure FP program to something like the slurry of events pouring in via DOM callbacks (inversion of control).  I have a feeling that FRP should be in the glue somewhere, but I am hoping to learn a bit from the approaches that others have taken (if anyone has even attempted this).

Does anyone have any examples of pure functional Scala.js GUIs, or any recommendations on libraries or resources that I might look into for building a pure functional Scala.js frontend?

Thank you very much!

William Harvey

--
You received this message because you are subscribed to the Google Groups "scala-user" group.
To unsubscribe from this group and stop receiving emails from it, send an email to <a href="javascript:" target="_blank" gdf-obfuscated-mailto="RZsLAbs0BAAJ" rel="nofollow" onmousedown="this.href=&#39;javascript:&#39;;return true;" onclick="this.href=&#39;javascript:&#39;;return true;">scala-user+...@googlegroups.com.
For more options, visit <a href="https://groups.google.com/d/optout" target="_blank" rel="nofollow" onmousedown="this.href=&#39;https://groups.google.com/d/optout&#39;;return true;" onclick="this.href=&#39;https://groups.google.com/d/optout&#39;;return true;">https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Groups "scala-user" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Any examples of pure functional Scala.js GUIs?

David Barri
In reply to this post by William Harvey
I recommend scalajs-react. I use it in a very large webapp in a very FP-manner. 99% of my app is pure and very strongly typed.

Some of the more FP-oriented online demos are:

(Disclaimer: am author of scalajs-react.)

--
You received this message because you are subscribed to the Google Groups "scala-user" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Any examples of pure functional Scala.js GUIs?

David Barri
Forgot to mention, it also comes with other stuff that become essential when you're building something Big and Serious.


Those are the highlights, there are other links on the project page.

(Again - Disclaimer: am author of scalajs-react.)

--
You received this message because you are subscribed to the Google Groups "scala-user" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Any examples of pure functional Scala.js GUIs?

Naftoli Gugenheim
In reply to this post by 杨 Yang博 Bo
What is this, Binding.scala for JavaFX??


On Thu, Feb 9, 2017 at 11:23 PM 杨 Yang博 Bo <[hidden email]> wrote:
You can use `onAction` attribute: For example: 

import javafx.application.Application
import javafx.event.{ActionEvent, EventHandler, EventType}
import javafx.stage.{PopupWindow, Stage, Window, WindowEvent}

final class FxmlSample extends Application {
@fxml override def start(primaryStage: Stage): Unit = {
import javafx.scene.layout.VBox
import javafx.scene.control._
import javafx.scene.Scene
def newWindow(text: String) = fxml.show {
<Stage title={text}>
<scene>
<Scene>
<Label>{text}</Label>
</Scene>
</scene>
</Stage>
}
val myScene = <Scene>
<VBox>
<Button onAction={ event: ActionEvent => newWindow("Newly created window")}>New Window</Button>
</VBox>
</Scene>
fxml.show(primaryStage, myScene)
}
}
object FxmlSample {
def main(args: Array[String]): Unit = {
Application.launch(classOf[FxmlSample], args: _*)
}
}

2017-01-26 18:39 GMT+08:00 Naftoli Gugenheim <[hidden email]>:
What about for handling clicks?

On Wed, Jan 25, 2017 at 11:48 PM 博 Bo 杨 Yang <[hidden email]> wrote:
Have you seen Binding.scala. There is a monad-based data-binding mechanism behind its HTML template syntactic sugar.

在 2017年1月25日星期三 UTC+8下午10:50:52,William Harvey写道:
Hi Everyone,

I am interested in building a Scala.js frontend for a web application that is written in a pure functional style.  Specifically, I would like to try to see how much mileage I can get out of the "onion architecture" proposed by John De Goes (link), but I am a bit unsure of the best practices for attaching an interpreter for the pure FP program to something like the slurry of events pouring in via DOM callbacks (inversion of control).  I have a feeling that FRP should be in the glue somewhere, but I am hoping to learn a bit from the approaches that others have taken (if anyone has even attempted this).

Does anyone have any examples of pure functional Scala.js GUIs, or any recommendations on libraries or resources that I might look into for building a pure functional Scala.js frontend?

Thank you very much!

William Harvey

--
You received this message because you are subscribed to the Google Groups "scala-user" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.



--
杨博 (Yang Bo)

--
You received this message because you are subscribed to the Google Groups "scala-user" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Groups "scala-user" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Any examples of pure functional Scala.js GUIs?

Naftoli Gugenheim
In reply to this post by 杨 Yang博 Bo
So, that would not be monad-based...


On Fri, Feb 10, 2017 at 1:51 AM 博 Bo 杨 Yang <[hidden email]> wrote:
And for Scala.js, use onclick

在 2017年1月26日星期四 UTC+8下午6:40:10,nafg写道:
What about for handling clicks?

On Wed, Jan 25, 2017 at 11:48 PM 博 Bo 杨 Yang <[hidden email]> wrote:
Have you seen Binding.scala. There is a monad-based data-binding mechanism behind its HTML template syntactic sugar.

在 2017年1月25日星期三 UTC+8下午10:50:52,William Harvey写道:
Hi Everyone,

I am interested in building a Scala.js frontend for a web application that is written in a pure functional style.  Specifically, I would like to try to see how much mileage I can get out of the "onion architecture" proposed by John De Goes (link), but I am a bit unsure of the best practices for attaching an interpreter for the pure FP program to something like the slurry of events pouring in via DOM callbacks (inversion of control).  I have a feeling that FRP should be in the glue somewhere, but I am hoping to learn a bit from the approaches that others have taken (if anyone has even attempted this).

Does anyone have any examples of pure functional Scala.js GUIs, or any recommendations on libraries or resources that I might look into for building a pure functional Scala.js frontend?

Thank you very much!

William Harvey

--
You received this message because you are subscribed to the Google Groups "scala-user" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].

For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Groups "scala-user" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Groups "scala-user" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Any examples of pure functional Scala.js GUIs?

杨 Yang博 Bo
A GUI framework need to interactive with real world, and real world is not pure.

In Binding.scala, the entire flow to  handle an event is:

(impure onclick handler) -> (monad-based data flow) -> (impure dom)


2017-02-22 11:49 GMT+08:00 Naftoli Gugenheim <[hidden email]>:
So, that would not be monad-based...


On Fri, Feb 10, 2017 at 1:51 AM 博 Bo 杨 Yang <[hidden email]> wrote:
And for Scala.js, use onclick

在 2017年1月26日星期四 UTC+8下午6:40:10,nafg写道:
What about for handling clicks?

On Wed, Jan 25, 2017 at 11:48 PM 博 Bo 杨 Yang <[hidden email]> wrote:
Have you seen Binding.scala. There is a monad-based data-binding mechanism behind its HTML template syntactic sugar.

在 2017年1月25日星期三 UTC+8下午10:50:52,William Harvey写道:
Hi Everyone,

I am interested in building a Scala.js frontend for a web application that is written in a pure functional style.  Specifically, I would like to try to see how much mileage I can get out of the "onion architecture" proposed by John De Goes (link), but I am a bit unsure of the best practices for attaching an interpreter for the pure FP program to something like the slurry of events pouring in via DOM callbacks (inversion of control).  I have a feeling that FRP should be in the glue somewhere, but I am hoping to learn a bit from the approaches that others have taken (if anyone has even attempted this).

Does anyone have any examples of pure functional Scala.js GUIs, or any recommendations on libraries or resources that I might look into for building a pure functional Scala.js frontend?

Thank you very much!

William Harvey

--
You received this message because you are subscribed to the Google Groups "scala-user" group.
To unsubscribe from this group and stop receiving emails from it, send an email to scala-user+...@googlegroups.com.

For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Groups "scala-user" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.



--
杨博 (Yang Bo)

--
You received this message because you are subscribed to the Google Groups "scala-user" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Any examples of pure functional Scala.js GUIs?

Naftoli Gugenheim
In reply to this post by William Harvey
Some data points...

https://github.com/Ahnfelt/react4s -- uses an emit method to send data instead of just calling a Unit-returning method on the props

Elm - instead of event attributes taking Unit-returning functions, they return an arbitrary "message" type, and you compose your "view" function with an update function that is Msg -> Model -> Model.

I think that could be implemented as an abstraction on top of React. I wouldn't mind having something like that in Scala.


On Wed, Jan 25, 2017 at 9:50 AM William Harvey <[hidden email]> wrote:
Hi Everyone,

I am interested in building a Scala.js frontend for a web application that is written in a pure functional style.  Specifically, I would like to try to see how much mileage I can get out of the "onion architecture" proposed by John De Goes (link), but I am a bit unsure of the best practices for attaching an interpreter for the pure FP program to something like the slurry of events pouring in via DOM callbacks (inversion of control).  I have a feeling that FRP should be in the glue somewhere, but I am hoping to learn a bit from the approaches that others have taken (if anyone has even attempted this).

Does anyone have any examples of pure functional Scala.js GUIs, or any recommendations on libraries or resources that I might look into for building a pure functional Scala.js frontend?

Thank you very much!

William Harvey

--
You received this message because you are subscribed to the Google Groups "scala-user" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Groups "scala-user" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Any examples of pure functional Scala.js GUIs?

杨 Yang博 Bo
You can easily implement those helpers in Binding.scala as you did in ReactJS https://facebook.github.io/react/docs/two-way-binding-helpers.html

2017-02-22 12:02 GMT+08:00 Naftoli Gugenheim <[hidden email]>:
Some data points...

https://github.com/Ahnfelt/react4s -- uses an emit method to send data instead of just calling a Unit-returning method on the props

Elm - instead of event attributes taking Unit-returning functions, they return an arbitrary "message" type, and you compose your "view" function with an update function that is Msg -> Model -> Model.

I think that could be implemented as an abstraction on top of React. I wouldn't mind having something like that in Scala.


On Wed, Jan 25, 2017 at 9:50 AM William Harvey <[hidden email]> wrote:
Hi Everyone,

I am interested in building a Scala.js frontend for a web application that is written in a pure functional style.  Specifically, I would like to try to see how much mileage I can get out of the "onion architecture" proposed by John De Goes (link), but I am a bit unsure of the best practices for attaching an interpreter for the pure FP program to something like the slurry of events pouring in via DOM callbacks (inversion of control).  I have a feeling that FRP should be in the glue somewhere, but I am hoping to learn a bit from the approaches that others have taken (if anyone has even attempted this).

Does anyone have any examples of pure functional Scala.js GUIs, or any recommendations on libraries or resources that I might look into for building a pure functional Scala.js frontend?

Thank you very much!

William Harvey

--
You received this message because you are subscribed to the Google Groups "scala-user" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to a topic in the Google Groups "scala-user" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/scala-user/fVho37sFuDo/unsubscribe.
To unsubscribe from this group and all its topics, send an email to [hidden email].

For more options, visit https://groups.google.com/d/optout.



--
杨博 (Yang Bo)

--
You received this message because you are subscribed to the Google Groups "scala-user" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Any examples of pure functional Scala.js GUIs?

Siddhartha Gadgil
Is this documented anywhere? A search on Binding's github repository for fxml yielded nothing.

Thanks,
Siddhartha

On Wednesday, February 22, 2017 at 10:53:04 AM UTC+5:30, 杨博 wrote:
You can easily implement those helpers in Binding.scala as you did in ReactJS <a href="https://facebook.github.io/react/docs/two-way-binding-helpers.html" target="_blank" rel="nofollow" onmousedown="this.href=&#39;https://www.google.com/url?q\x3dhttps%3A%2F%2Ffacebook.github.io%2Freact%2Fdocs%2Ftwo-way-binding-helpers.html\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNFiSTbMJ0ypoRvbMjuNyviPVDXLsw&#39;;return true;" onclick="this.href=&#39;https://www.google.com/url?q\x3dhttps%3A%2F%2Ffacebook.github.io%2Freact%2Fdocs%2Ftwo-way-binding-helpers.html\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNFiSTbMJ0ypoRvbMjuNyviPVDXLsw&#39;;return true;">https://facebook.github.io/react/docs/two-way-binding-helpers.html

2017-02-22 12:02 GMT+08:00 Naftoli Gugenheim <<a href="javascript:" target="_blank" gdf-obfuscated-mailto="addzCre5DAAJ" rel="nofollow" onmousedown="this.href=&#39;javascript:&#39;;return true;" onclick="this.href=&#39;javascript:&#39;;return true;">nafto...@...>:
Some data points...

<a href="https://github.com/Ahnfelt/react4s" target="_blank" rel="nofollow" onmousedown="this.href=&#39;https://www.google.com/url?q\x3dhttps%3A%2F%2Fgithub.com%2FAhnfelt%2Freact4s\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNFEqr-7bCmSdpnikh0ktabswaan2g&#39;;return true;" onclick="this.href=&#39;https://www.google.com/url?q\x3dhttps%3A%2F%2Fgithub.com%2FAhnfelt%2Freact4s\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNFEqr-7bCmSdpnikh0ktabswaan2g&#39;;return true;">https://github.com/Ahnfelt/react4s -- uses an emit method to send data instead of just calling a Unit-returning method on the props

Elm - instead of event attributes taking Unit-returning functions, they return an arbitrary "message" type, and you compose your "view" function with an update function that is Msg -> Model -> Model.

I think that could be implemented as an abstraction on top of React. I wouldn't mind having something like that in Scala.


On Wed, Jan 25, 2017 at 9:50 AM William Harvey <<a href="javascript:" target="_blank" gdf-obfuscated-mailto="addzCre5DAAJ" rel="nofollow" onmousedown="this.href=&#39;javascript:&#39;;return true;" onclick="this.href=&#39;javascript:&#39;;return true;">harv...@...> wrote:
Hi Everyone,

I am interested in building a Scala.js frontend for a web application that is written in a pure functional style.  Specifically, I would like to try to see how much mileage I can get out of the "onion architecture" proposed by John De Goes (<a href="http://degoes.net/articles/modern-fp-part-2" target="_blank" rel="nofollow" onmousedown="this.href=&#39;http://www.google.com/url?q\x3dhttp%3A%2F%2Fdegoes.net%2Farticles%2Fmodern-fp-part-2\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNHa48d5mJwVakWktQB3mhbL0Vaxtg&#39;;return true;" onclick="this.href=&#39;http://www.google.com/url?q\x3dhttp%3A%2F%2Fdegoes.net%2Farticles%2Fmodern-fp-part-2\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNHa48d5mJwVakWktQB3mhbL0Vaxtg&#39;;return true;">link), but I am a bit unsure of the best practices for attaching an interpreter for the pure FP program to something like the slurry of events pouring in via DOM callbacks (inversion of control).  I have a feeling that FRP should be in the glue somewhere, but I am hoping to learn a bit from the approaches that others have taken (if anyone has even attempted this).

Does anyone have any examples of pure functional Scala.js GUIs, or any recommendations on libraries or resources that I might look into for building a pure functional Scala.js frontend?

Thank you very much!

William Harvey

--
You received this message because you are subscribed to the Google Groups "scala-user" group.
To unsubscribe from this group and stop receiving emails from it, send an email to <a href="javascript:" target="_blank" gdf-obfuscated-mailto="addzCre5DAAJ" rel="nofollow" onmousedown="this.href=&#39;javascript:&#39;;return true;" onclick="this.href=&#39;javascript:&#39;;return true;">scala-user+...@googlegroups.com.
For more options, visit <a href="https://groups.google.com/d/optout" target="_blank" rel="nofollow" onmousedown="this.href=&#39;https://groups.google.com/d/optout&#39;;return true;" onclick="this.href=&#39;https://groups.google.com/d/optout&#39;;return true;">https://groups.google.com/d/optout.

--
You received this message because you are subscribed to a topic in the Google Groups "scala-user" group.
To unsubscribe from this topic, visit <a href="https://groups.google.com/d/topic/scala-user/fVho37sFuDo/unsubscribe" target="_blank" rel="nofollow" onmousedown="this.href=&#39;https://groups.google.com/d/topic/scala-user/fVho37sFuDo/unsubscribe&#39;;return true;" onclick="this.href=&#39;https://groups.google.com/d/topic/scala-user/fVho37sFuDo/unsubscribe&#39;;return true;">https://groups.google.com/d/topic/scala-user/fVho37sFuDo/unsubscribe.
To unsubscribe from this group and all its topics, send an email to <a href="javascript:" target="_blank" gdf-obfuscated-mailto="addzCre5DAAJ" rel="nofollow" onmousedown="this.href=&#39;javascript:&#39;;return true;" onclick="this.href=&#39;javascript:&#39;;return true;">scala-user+...@googlegroups.com.

For more options, visit <a href="https://groups.google.com/d/optout" target="_blank" rel="nofollow" onmousedown="this.href=&#39;https://groups.google.com/d/optout&#39;;return true;" onclick="this.href=&#39;https://groups.google.com/d/optout&#39;;return true;">https://groups.google.com/d/optout.



--
杨博 (Yang Bo)

--
You received this message because you are subscribed to the Google Groups "scala-user" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Any examples of pure functional Scala.js GUIs?

杨 Yang博 Bo
See https://github.com/ThoughtWorksInc/Binding.scala/wiki/FXML

You can try the 11.0.0-M1 version for the FXML feature.

2017-02-23 14:26 GMT+08:00 Siddhartha Gadgil <[hidden email]>:
Is this documented anywhere? A search on Binding's github repository for fxml yielded nothing.

Thanks,
Siddhartha

On Wednesday, February 22, 2017 at 10:53:04 AM UTC+5:30, 杨博 wrote:
You can easily implement those helpers in Binding.scala as you did in ReactJS https://facebook.github.io/react/docs/two-way-binding-helpers.html

2017-02-22 12:02 GMT+08:00 Naftoli Gugenheim <[hidden email]>:
Some data points...

https://github.com/Ahnfelt/react4s -- uses an emit method to send data instead of just calling a Unit-returning method on the props

Elm - instead of event attributes taking Unit-returning functions, they return an arbitrary "message" type, and you compose your "view" function with an update function that is Msg -> Model -> Model.

I think that could be implemented as an abstraction on top of React. I wouldn't mind having something like that in Scala.


On Wed, Jan 25, 2017 at 9:50 AM William Harvey <[hidden email]> wrote:
Hi Everyone,

I am interested in building a Scala.js frontend for a web application that is written in a pure functional style.  Specifically, I would like to try to see how much mileage I can get out of the "onion architecture" proposed by John De Goes (link), but I am a bit unsure of the best practices for attaching an interpreter for the pure FP program to something like the slurry of events pouring in via DOM callbacks (inversion of control).  I have a feeling that FRP should be in the glue somewhere, but I am hoping to learn a bit from the approaches that others have taken (if anyone has even attempted this).

Does anyone have any examples of pure functional Scala.js GUIs, or any recommendations on libraries or resources that I might look into for building a pure functional Scala.js frontend?

Thank you very much!

William Harvey

--
You received this message because you are subscribed to the Google Groups "scala-user" group.
To unsubscribe from this group and stop receiving emails from it, send an email to scala-user+...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to a topic in the Google Groups "scala-user" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/scala-user/fVho37sFuDo/unsubscribe.
To unsubscribe from this group and all its topics, send an email to scala-user+...@googlegroups.com.

For more options, visit https://groups.google.com/d/optout.



--
杨博 (Yang Bo)

--
You received this message because you are subscribed to a topic in the Google Groups "scala-user" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/scala-user/fVho37sFuDo/unsubscribe.
To unsubscribe from this group and all its topics, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.



--
杨博 (Yang Bo)

--
You received this message because you are subscribed to the Google Groups "scala-user" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.
Loading...