Closed nelsonic closed 7 years ago
I put labeled this issue as in-pogress
and then immediately got called away (distracted) for T2h
!! 😧
"No Runtime Exceptions" ... LoL! 🤣 But seriously, this is not Elm's fault.
Reported issue: https://github.com/evancz/guide.elm-lang.org/issues/118 will update if it happens again, or close if not. 👍
https://guide.elm-lang.org Introduction section shows a code for "counter":
Copied "viewDot" example from: https://youtu.be/jl1tGiUiTtI?t=4m42s
-- Read more about this program in the official Elm guide:
-- https://guide.elm-lang.org/architecture/user_input/buttons.html
import Html exposing (beginnerProgram, div, button, text)
import Html.Events exposing (onClick)
main =
beginnerProgram { model = 0, view = view, update = update }
view model =
div []
[ button [ onClick Decrement ] [ text "-" ]
, div [] (List.map viewDot (List.range 1 model))
, button [ onClick Increment ] [ text "+" ]
]
viewDot n =
text "*"
type Msg = Increment | Decrement
update msg model =
case msg of
Increment ->
model + 1
Decrement ->
model - 1
Easily transforms the counter from a number to a sequence of "dots".
Getting the following error: elm-make: Map.!: given key is not an element in the map
ran:
elm-make buttons-viewdot.elm
Then it works if you visit: http://localhost:8000/examples/index.html
Atom is not cooperating right now ...
Downloading the latest version of Atom to see if it works:
Meanwhile using SublimeText ...
Still getting the error:
Recommended remedy https://github.com/elm-lang/elm-package/issues/254#issuecomment-278760570 is: 1 in 50 (2%) isn't great failure rate ... 🙄
Deleted and re-installed:
Works:
If you see: I cannot find module 'Svg'.
:
https://guide.elm-lang.org/architecture/effects/time.html
elm-package install elm-lang/svg
as per: https://github.com/elm-lang/error-message-catalog/issues/235#issuecomment-325179451
https://guide.elm-lang.org/architecture/effects/web_sockets.html
I cannot find module 'WebSocket'.
Module 'Main' is trying to import it.
Potential problems could be:
* Misspelled the module name
* Need to add a source directory or new dependency to elm-package.json
Install it:
elm-package install elm-lang/websocket
Finished going through all the elm examples for v 0.18 and feel a lot more confident in my elm skills.
I haven't written Elm code in a few months ... 😞 So I'm going through the examples on: https://guide.elm-lang.org to refresh ahead of next week! PDF snapshot at time of writing (when I am doing the exercises): an-introduction-to-elm.pdf