462521 (1) [Avatar] Offline
#1
Elm in Action v5 MEAP:

  • Page 76: SurpriseMe index is incorrect. Should be SurpriseMe (without index)

  • Page 161: Wrong picture for Figure 6.2

  • Page 170: The file name TestPhotoGroove.elm is incorrect. Should be PhotoGrooveTests.elm

  • Page 174: SetUrl is incorrect. Should be SelectByUrl

  • Page 174: Typo: intiial model

  • Page 182: attribute "src" is no longer valid (doesn't compile). Should be Attr.attribute <| Attr.src

  • Page 187: urlToClick is incorrect. Should be urlToSelect


  • Hope this helps. Great book!
    394895 (2) [Avatar] Offline
    #2
    ... to attribute src - (Attr is a bit misleading, also Attr.attribute does not exist)
    it actually should be

    import Html.Attributes as Attr
    ...
    thumbnailRendered url query =
                        query
                            |> Query.findAll [ tag "img", attribute <| Attr.src (urlPrefix ++ url) ]
                            |> Query.count (Expect.atLeast 1)
    

    551042 (1) [Avatar] Offline
    #3
    96: "This Request value serves a similar purpose to the Random.Generator value we passed to Random.generate in Chapter 3" - "similar to" ?

    97: "If the request fails for any reason, we’ll want to know went wrong so we can inform the user" - missing word?

    100: "You can use _ either in function parameter lists or in case-expression branches" - wrong font

    101: "The LoadPhotos (Ok responseStr) branch runs if msg is a LoadPhotos type constructor which contains an Ok value" - indentation (only in ePub)

    106: "As long as we give it a function of that type, Html.program could care less what that function is called" - couldn't ?

    110: "We could decode this using thet technique we just learned, with one slight difference" - "the"

    112: "WARNING Reordering any function’s arguments can lead to unpleasant surprises. Since reordering the fields in the Model type alias has the consqeuence of reordering the Model function’s arguments, you should be exactly as careful when reordering a type alias as you would be when reordering any function’s arguments" - consequence

    Awesome book, btw!
    560315 (2) [Avatar] Offline
    #4
    chapter-4/v-5/1
    --------------------

    We could decode this using thet technique we just learned, with one slight difference. ...
    560315 (2) [Avatar] Offline
    #5
    chapter-4/v-5/1

    this piece of code doesn't make sense -
    Task.perform handleLoadFailure handleLoadSuccess


    initialCmd : Cmd Msg
    initialCmd =
        "http://elm-in-action.com/breakfast-burritos/list"
            |> Http.getString
            |> Task.perform handleLoadFailure handleLoadSuccess
    
    235576 (1) [Avatar] Offline
    #6
    Elm in Action v5, p14 of the PDF.

    This paragraph ends 'istelf'; should be 'itself':

    JavaScript has several ways of organizing string-related functionality: fields on a string, methods on a string, or methods on the String global istelf.
    443922 (1) [Avatar] Offline
    #7
    Elm in action MEAP v7

    p59

    states in chapter summary:
    Html.beginnerProgram wires together model , view , and update


    but the chapter now uses Browser instead of beginnerProgram
    MarkF (11) [Avatar] Offline
    #8
    v07 Chapter 1. Pdf version.
    p14 states "Let’s import the String module and try out some of its functions.", but doesn't show import String in Listing 1.9 (titled Importing functions) and String doesn't need to be imported into REPL (v0.19).
    p18 Listing 1.12 includes import Char, which is also not needed in REPL, at least when I tried it. Are the default imports for REPL different from the compiler, as https://elm-lang.org/0.19.0/imports does not include Char as one of its default imports?
    MarkF (11) [Avatar] Offline
    #9
    v07 Chapter 2. Pdf version.
    p32 last rules declaration has the comma before the last rule rather than the second rule. (This is my entry for the most pedantic typo competition).
    p37 "Elm code running in the <div id="elm-area"></div> element we included in index.html." should be "Elm code running in the <div id="app"></div> element we included in index.html.".
    p50 Figure 2.11 has msg.operation = "SELECT_PHOTO", but on page 49 it is description = "ClickedPhoto".
    p59 (as 443922 has already spotted) Html.beginnerProgram is now Browser.sandbox.
    MarkF (11) [Avatar] Offline
    #10
    v07 Chapter 3. Pdf version.
    p66 Figure 3.2 is not displaying properly.
    p76 Fifth word, 'of', should not be there. Also the 'it' in the third line of the TIP should also be removed.
    MarkF (11) [Avatar] Offline
    #11
    v07 Chapter 4. Pdf version.

    p96. The 'Great!' sentence at the top needs to move down to just before 'MANAGED EFFECTS...'
    Also the package is now elm/http and is installed using 'elm install elm/http'.

    p105. Penultimate paragraph, "we don't need run" needs a "to" inserting.

    p106. 4.2.4 change 1. mentions a ReportError for the first time and the Note at the top of the next page refers to it. Does not exist before or after.

    p112. NoRedInk/elm-decode-pipeline is now NoRedInk/elm-json-decode-pipeline and, as above, it's "elm install". And we also need to install elm/json. Also in Listing 4.2 "decode" needs to be replaced by "succeed" and the import statements above the listing need to be adjusted accordingly. Needs to be changed on page 117 too in 'Listing 3.7' which should be 'Listing 4.3'.

    p114. You have the order of get's arguments the wrong way round!

    p115. in viewThumbnail toString should now be String.fromInt.

    p118 Listing 3.7 has not been updated to use Browser instead of Html.
    MarkF (11) [Avatar] Offline
    #12
    v07 Chapter 5. Pdf version.

    p125. Listing 5.1 has 'toString' which needs to be 'String.fromInt'.

    p139. 'var app = Elm.PhotoGroove' has not been update to use Browser instead of Html. This is both in the <code> section and the paragraph following it. Same problem in <code> section on pages 145 and 147. Also pages 149 and 150 are all still Html rather than Browser.

    p152. Mention Html.programWithFlags. Again should be Browser.element. Listing 5.6 and 5.7 are similarly out of date.
    waltercodes (1) [Avatar] Offline
    #13
    The intro mentions that we want to run the examples against elm 0.18.0. When doing so, calls to `String.fromFloat` fail with "`String` does not expose `fromFloat`." but `toString` works. I re-installed elm 0.19.0 and verified that `String.fromFloat` works but `toString` fails. I wonder if that's worth mentioning in the book?