elm-in-action
elm-in-action copied to clipboard
MEAP3 - What is the PhotoGroove code at the end of chapter 3?
The text of chapter three does not show completely what is the complete code of PhotoGroove.elm after introducing the random number generator. We miss:
- a complete list of the Msg subtypes
- what
update
must do in case ofSelectByIndex index
The file provided in this repository shows clearly the final code at the end of further chapters. The content of update contains some applyFilters
operator that pollutes things.
I have tried to massage and adjust my code, but I have come to the error message:
The 2nd branch has this type:
( Model, Cmd Msg )
But the 3rd is:
( { chosenSize : ThumbnailSize
, photos : List Photo
, selectedUrl : Maybe String
}
, Cmd msg
)
I am trying to fix it myself, but I'd appreciate some assistance. It's really frustrating that such a minor thing like random generators should stop me from proceeding in the book.
Please put complete instances of PhotoGroove.elm at different chapters and paragraphs.
Here it goes...
Psst - I think Richard is still out on his honeymoon but I'm sure he'll address this when he can.