-
Notifications
You must be signed in to change notification settings - Fork 367
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
Syntax overview does not explain the mysterious .s and $s #19
Comments
I'm still trying to wrap my head around this entire paradigm (functional programming, FRP, etc) and its syntax. However, I'm pretty sure (.) and ($) in Elm work exactly like this: http://stackoverflow.com/questions/940382/haskell-difference-between-dot-and-dollar-sign. Hopefully that link gives you something to mull over and experiment with until someone knowledgable can answer more concretely. |
Thanks for the pointer, but I still think this should be explained in the syntax page, or the syntax page should mention "we expect you to be familiar with Haskell syntax" (or something like that). |
Oh, my bad! I thought you were asking a question. Anyway, I agree. The current information on the syntax page is great if you already have a background in a similar language. However, if you come from a more imperative-style of programming, like myself, you'll find yourself spending a lot of time reading about Haskell syntax and general concepts before you can even experiment with Elm productively. Alongside your points on the (.) and ($) operators perhaps we can pool some ideas here (or open an issue specifically for this) to make learning Elm and little easier for newcomers? For example, if the concept of "lifting" was explained on the site with a few examples I think I would've been able to experiment a little easier. Lifting is brought up briefly on the "What is FRP" page, but I don't think it does the concept justice at all. |
Did you both start looking at Elm after the 0.7 release? That's when the alternative lift syntax (<~) and the record accessor syntax (.label) got introduced, and I was worried that it would cause exactly this kind of confusion. I'll add something to the syntax page about it, but do you think I should just stick to using Also, what would help in understanding lift? There is no central document on that, but until the 0.7 release, a bunch of the examples were dedicated to showing how to use it. Now many of them use the (<~) though, making these examples seem less related to lifting functions onto signals perhaps. |
Yes, I was following the project sometime before but I did not start looking at the examples until after 0.7. If you want to keep the whole "learn by example" feel to the site I think switching back to using |
I started before 0.7, I would agree than explicit As a suggestion, for the examples section, having hyperlinking from the source code the documentation would be awesome. You see code, "what the lift function ?", click on the function and jump to the relevant documentation. Obviously this conflicts with the "right away editable", but this seems not insurmountable (hot hyperlinking, or switch between read and edit mode; most demos would be in read mode by default). |
I have locally changed things back to using On the topic of adding tighter integration with the relevant documentation, it looks like madscoaducom is working on just that! |
Everything has been answered except for $. Recommend adding docs. |
Great :) We'll see if more |
When looking at simple examples like
http://elm-lang.org/edit/examples/Reactive/TextField.elm
The main source of mystery mights come from the lifting operators (<~) and the .s and $s
Neither of them are mentioned in http://elm-lang.org/learn/Syntax.elm which is where I would expect to find the explanation.
The text was updated successfully, but these errors were encountered: