The Author Online Book Forums are Moving

The Author Online Book Forums will soon redirect to Manning's liveBook and liveVideo. All book forum content will migrate to liveBook's discussion forum and all video forum content will migrate to liveVideo. Log in to liveBook or liveVideo with your Manning credentials to join the discussion!

Thank you for your engagement in the AoF over the years! We look forward to offering you a more enhanced forum experience.

462521 (1) [Avatar] Offline
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
    ... 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.findAll [ tag "img", attribute <| Attr.src (urlPrefix ++ url) ]
                            |> Query.count (Expect.atLeast 1)

    551042 (1) [Avatar] Offline
    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

    We could decode this using thet technique we just learned, with one slight difference. ...
    560315 (2) [Avatar] Offline

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

    initialCmd : Cmd Msg
    initialCmd =
            |> Http.getString
            |> Task.perform handleLoadFailure handleLoadSuccess
    235576 (1) [Avatar] Offline
    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
    Elm in action MEAP v7


    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
    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 does not include Char as one of its default imports?
    MarkF (11) [Avatar] Offline
    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
    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
    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
    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
    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?
    609044 (1) [Avatar] Offline
    I just finish reading the book and liked it very much, I've made some notes during my reading and would like to share them with you, hopping they will help.

    I'm not a native english speaker and made the note with brevity in mind, I'am sorry if them seem inappropriate at any time, this is certainly not my intention.

    ### Pag. 37:
    Last paragraph before _Compiling to javascript_ has the code `<div id="elm-area"></div>`,
    but in the code above we were using `<div id="app"></div>`

    ### Pag. 66:
    Figure 3.2 is broken, part of the code on the left is cutted out.

    ### Pag. 76:
    First code block. We have `ClickedSurpriseMe index` grayed out, but we should
    have `ClickedSurpriseMe` alone.

    ### Pag.82:
    In _Upgrading main to use Browser.element_ we are using Browser.element and the
    text after the first code snippet says `Html.beginnerProgram`

    ### Pag. 91:
    In _Propagating changes_ after the first code snippet we have the sentence `Our
    SelectByIndex logic [...]`, this should be GotSelectedIndex.

    ### Pag. 93:
    In _Fixing selectbyindex_, we have name the logic `GotSelectedIndex` previously.
    The SelectByIndex name is used erroniously in this entire section.

    ### Pag. 96:
    Installation of elm/http, the command in the book is `elm-package install
    elm-lang/http` the correct would be `elm install elm/http`

    ### Pag. 109:
    First note inside _Decoging primitives_ section. It says that elm repl always
    prints Result.Result to avoid ambiguity, but may repl is printing simply Result
    maybe this behaviour changed in elm 19?

    ### Pag. 112:
    Bad installation instructions to the Pipeline Decoding.
    NoRedInk/elm-decode-pipeline has become NoRedInk/elm-json-decode-pipeline
    Also the usage of the Json.Decode.Pipeline has changed from the one presented in
    the book.

    ### Pag. 115:
    In section _Rendering the metadata_, in elm 0.19 the function toString has been
    replaced by String.fromInt.

    ### Pag. 125:
    Listing 5.1 inside section _Viewing the sliders_ we have a use of toString, that
    does not exists more in 0.19. We should have String.fromInt to work properly.

    In the same section the book says I should have a ambiguous name `max` when I
    add this name to the list of Html.Attributes qualified imports, nonetheless this
    did not happened to me. It just compiled. I'm following the book code as close as
    possible, the single change I've made is not to use of the decode pipeline. I
    did not found a good reason for this to work reading the elm 0.19 changes.

    ### Pag. 135:
    in _Type variable in values_ section, after the fromList type anotation we have
    `List String -> Cmd msg functions is the [...]` but we havend defined a `List
    String -> Cmd msg` function but a `FilterOptions -> Cmd msg` one. I don't really
    know if I misunderstud something here.

    ### Pag. 137:
    I have the impression that the code written during the chapters is different
    from the ones presented at the end of each chapter. Sems to me we have 2
    versions of the code. In the section _Calling setfilters when users selec
    photos_ I don't have the SelectByUrl update portion of the code in my copy,and I
    have been following the book very closly. But When I went back to see the
    previous chapter full code this update case is defined. In fact all update msgs
    are different from the ones I've been writing. I've made a summary of the naming
    differences between my update function and the code in the book in the table

    | My code | Chapter 4 code sumary |
    | GotSelectedIndex | SelectByIndex |
    | ClickedPhoto | SelectByUrl |
    | ClickedSurpriseMe | SurpriseMe |
    | ClickedSize | SetSize |

    Apparently the values in the 'Chapter 4 code sumary' are used in the rest of the

    ### Pag. 146:
    In the note, neigther elm-lang/window nor elm-lang/mouse are compatible with elm
    0.19 at the moment.

    ### Pag. 149:
    In the section _sending initialization data to programwithflags_ the text and
    code examples are out of date. We are using `Browser.element` in our code and
    the book is saying `Html.program` and `Html.programWithFlags`.

    ### Pag. 150:
    The code to call the Elm.PhotoGroove from with index.html is outdated and is not
    similar to the one we are using in our program.

    ### Pag. 160:
    Figure 6.1 does not represent the code structure used throughout the book, we
    added PhotoGroove.elm in a src directory. This confused me about the directory I
    should run the command `elm-test init`. Also the `elm-test init` in version 0.19
    creates a elm.json and not an elm-package.json.

    ### Pag. 162:
    Figure 6.2 seams to be wrong.

    ### Pag. 163:
    In tye _Why the function wrapper?_ note you explain the unit type (). We have
    already seen it in a previous chapter, it could be only referenced here!
    (It is just a FYI, I don't think this repetion hurts in any way)

    ### Pag. 176:
    In _Making Commands Testable_ references `programWithFlags` when we are using
    `Broser.element` in our code.

    ### Pag. 178:
    The hole 6.3 section has a problem the the 'eeue56/elm-html-test' module is not
    compatible with elm 0.19.
    I've also seen the PR that brings this module to `elm-exploration/test', se even
    after the PR is accepted and the package published, at least the beggining of
    this section needs a review.

    ### Pag. 194:
    Last paragraph has reference to `Html.begginerProgram` and `Html.program` but we
    have used the `Browser` module in its place

    ### Pag. 196:
    The code snippets use Html.program, but previously we were using
    Browser.element, I don't know if it was intended to keep the standard or to do a
    different program here

    ### Pag. 198:
    In code snippet `Listing 7.2 PhotoFolders.elm` toString is used, but in elm 0.19
    we should use String.fromInt

    ### Pag. 214:
    In the code in `Listing 7.4 viewFolder with toggling expanded` we used the
    name `content` for the content of a folder, but previously we had used
    `subfolders`. There is no error here, the only thing is that for me it seems
    that this change in naming has no improvement. Since the rest of the chapter use
    the content convetion, I would change the first iterations of the code for using
    content since the beggining.

    ### Pag. 215:
    `Figure 7.7` does not represents the exact CSS we have now in the application,
    there is no carrots in the image. This is very very minor...
    verrchu (2) [Avatar] Offline
    MEAP v9

    Page 36

    Let’s <some verb probably missed here> a file named index.html in the same directory as our elm.json.