elm / elm-lang.org

Server and client code for the Elm website.
http://elm-lang.org/
BSD 3-Clause "New" or "Revised" License
1.99k stars 366 forks source link

Code examples in docs are out of sync #570

Closed barefootford closed 5 years ago

barefootford commented 8 years ago

http://elm-lang.org/examples/field:

-- UPDATE
type Msg = NewContent String

update (NewContent content) oldContent =
  content

Current Gitbook (and the website too?) https://www.gitbook.com/book/evancz/an-introduction-to-elm/details:

-- UPDATE
type Msg   = Change String
update : Msg -> Model -> Model
update msg model = 
  case msg of
    Change newContent ->
      { model | content = newContent }

I'm new to Elm so I'm not sure which of these is the newer syntax. BUT, given how many people try out Elm anytime a new version is released, it would be cool to have all the docs and demo code synced up before publishing the new stuff.

psibi commented 8 years ago

It's also out of sync in guide. Example: Guide link: http://guide.elm-lang.org/architecture/user_input/buttons.html Example link: http://elm-lang.org/examples/buttons

Note that the example link is linked from the guide itself. It is very confusing to find different code when "See online" link is clicked.

mostlybadfly commented 8 years ago

Hello, new Elm learner here. I also found a difference between the guide examples and the elm-lang.org/examples/*

What is considered to be the newest/best syntax to use here? if these are both available on the repo i'd be happy to update one to match the other.

paul-barry-kenzan commented 7 years ago

To piggy back off this issue, I'm also seeing an incomplete example for Effects > Random. Comparing the provided code example and the steps within the guide, it's clear that the guide is missing some important steps, specifically it's missing any mention of Subscriptions, nor is there mention of the proper configuration of Html.program.

As a developer (as well as a trained Instructional Designer) attempting to learn Elm, it's frustrating to hit a wall while stepping through an official Elm-provided guide. Are there any plans to update the guide to ensure they are in working order?

cc: @evancz

EDIT: Added link to Random guide page

evancz commented 5 years ago

The examples are down for now, but the plan is to make sure they are synced up properly when they come back.