-
Notifications
You must be signed in to change notification settings - Fork 12
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
monadic computations in Reflex #5
Comments
Hi. I'm a nobody, so it could very well be the case that I either don't know what I'm talking about, or my thoughts don't matter in the grand scheme of things. As such, take what follows with a grain of salt sifted by a developer whose genuinely interested in seeing ReflexFRP's documentation improve. While I'm sure a comparison to Elm would be useful, I wonder how much would have to go into such a comparison to make it useful. Not only are the languages significantly different with respect to the expressiveness of the available abstractions, but they are even modeled on different forms of FRP (signals vs behaviors and events). Indeed, recent versions of Elm aren't even based on FRP anymore. Given that Elm has never had monads, I feel like the exposition required to sufficiently introduce them might generate enough content to be considered its own documentation. Furthermore, GHCJS's FFI is much lower-level than Elm's concept of Ports (or whatever they are using now for talking to native JavaScript libraries). To be clear, I think such a comparison would be useful, both to those seeking the greater power that Haskell provides, or those wishing to avoid the complexity introduced by a more powerful type system and (robust?) FRP implementation. I suppose what I'm most curious about is what is the minimum amount of work that needs to be done to make such a comparison useful? Can it be broken down such that a naive comparison could be written to offer users a quick glimpse, and then built upon to be used as a migration guide of sorts? Is such a comparison better done in a project meant to explicitly showcase the difference between different platforms (something like TodoMVC or FRP Zoo, but with more commentary, perhaps)? |
@Aspidites Elm's compiler is written in Haskell which uses monads extensively, but we never write or deal with ourselves. Elm was FRP and with subscriptions, it now uses a slightly different organizing principle for user input. Is the comparison to Elm necessary? No. Reflex extensively uses monads and the programmer must be comfortable with them. A newcomer probably doesn't know what is
and the new programmer probably doesn't care. If I were just interested in reading a website, I would not use reflex with it's limited documentation and confusing types. It is one of the least user-friendly libraries I have encountered. Haskell's type system is pretty useless right now because I can't even build Hello World. and none of the types make sense to me. I would do very well to give up and try another library. Reflex as a platform is logically compete, but not very user friendly. My strategy will be to use wrappers around the basic These comparisons may have to run very deep, because Haskell is a deep language. There's I first learned Elm and then reflex. So now I'm comparing the two. I am not a computer scientist. When I say FRP it doesn't really mean anything This looks good enough. I think that guy works much harder on the documentation then we do . As for signals, I found this thread [1] :
Ryan seems to have fewer opinions about stuff like this, and I can put in my own. Choices like these will have profound influences on how I build websites, but in the end I do whatever it takes to build website... |
@Aspidites there's nothing stopping you from creating your own TodoMVC-type example and supplying your own commentaries. I am sure your pull request will be accepted here! I had to look these up. Half the internet is just clicking a button and something happens on the page. |
comparison to Elm architecture
there are a few other FRP around. in particular I had a lot of confusion moving from Elm to Reflex. One difference, possibly is that Reflex, being written in Haskell is monadic. The web page is a side effect of other computations. Although Elm compiler is written in Haskell, Elm is it's own separate language and an architectures. All the HTML , SVG, CSS and other DOM elements have been turned into functions that fit into " the Elm architecture". These are not side effects there are no monads.
Finally while all elements are instances of
el
orelAttr
in Reflex, there's some distinction between dynamic and static elements, elements with attributes and elements without. I found it easier to just useelement
and lenses and define my own methods.There's also confusion with
ghcjs
which is almost completely separate.From the teaching point of view, it will be helpful to review monads and the Haskell arrows as they play out specifically in Reflex. These are just my thoughts and I'm writing about it on my own GitHub.
The text was updated successfully, but these errors were encountered: