Elm

The future of frontend web dev, I think.

To check out

Annoying

Notes

Modules.

Performance

Questions

Questions, for after the tutorial. Thank you for not running away with hyperfocus, executive function. You're getting chocolate later for sure.

Side tangent questions that are not helpful for productivity, only interest

    1. It's "when you introduce a feature is a feature", and (roughly) "you should try to solve problems with simpler tools first so you keep the language accessible".
    1. Oh, it's because you can call a record constructor on an aliased record just like a regular multi-parameter constructor! type alias Person = { name: string, age: Int } means you can call Person "Jack" 27.
  1. How often do we really need monads? https://discourse.elm-lang.org/t/best-way-to-write-intensely-monadic-code-in-elm/10434/6

Black holes of complexity that I swear I will not research unless they directly affect me

Errors in guide

Make a PR after you're done

  1. https://guide.elm-lang.org/effects/json. "The main difference is in the getRandomCatGif definition" should be "The main difference is in the getRandomQuote definition"
  2. Add hyperlinks for package dependencies in the package docs, ie Task should have a hyperlink on this page
  3. https://guide.elm-lang.org/webapps/url_parsing is missing the example under "Synthesis", but I can probably write it

Helpful examples

Not useful for any brain but my own. Code that I have written, and hence, hopefully can remember, which showcases Elm features.

Does a password have at least 8 characters, an uppercase character, a lowercase character, and a digit?

validatedPassword : String -> Result String ()
validatedPassword p =
  let
	  -- Function composition | (f >> g) x === g (f x)
	  containsNumber = String.toList >> List.filter (Char.isDigit) >> List.length >> (==) 0 >> not
  in
  -- Regular function application | f x
  if String.length p < 8 then Err "Password must be at least 8 characters"
  else if String.toLower p == p then Err "Password must contain at least one uppercase character"
  else if String.toLower p == p then Err "Password must contain at least one uppercase character"
  -- Piped function application | x |> f
  else if p |> containsNumber |> not then Err "Password must contain at least one numeric character"
  else Ok ()

Two-way synchronised input with temperature converter