Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Questions: How do you do __ in Elm? #24

Open
2 of 36 tasks
badlydrawnrob opened this issue Jan 31, 2024 · 0 comments
Open
2 of 36 tasks

Questions: How do you do __ in Elm? #24

badlydrawnrob opened this issue Jan 31, 2024 · 0 comments

Comments

@badlydrawnrob
Copy link
Owner

badlydrawnrob commented Jan 31, 2024

General

  1. Group all "beginner" knowledge together.1
    • What knowledge would you leave for a second book??
    • Keep in simple types? Leave out complex types?
  2. 🤖 Prompt engineering for education
  3. Create a better Q&A (a sort of faqs) with file samples
  4. "Lessons learned" redux from the how-to-elm files
    • Do this, don't do that, so on.

Don't do this

  • ⚠️ Getters and setters are often a bad sign.

Components

JSON Decode

Http.put and .post to the server

Debugging your code

List recursion

Working with data

Records

  1. What is an extensible record in Elm?

Working with Maybe and "lifting"

Working with types

What is a type constructor?
Also see 🛝 strongly typed (in various languages)

Working with .classes

Working with tags and permissions

Do tricks with case expressions?

Destructuring with case expressions

Understanding Cmd and generators

What's _ underscore used for?

pg. 96 of "Elm in Action" pdf

Elm patterns

  • Elm patterns
    • Might be a bit outdated but covers "Railway pattern", "Pipeline builder" etc.

Using <| function operators

Building URLS

⏳ Code performance and speed

How to Test for Slow Functions

What you are looking for is called a profiler.

⚠️ A word of advice: Get your software working first, then worry about profiling and optimizations. Many programmers get stuck in hyper-optimizing their code without first finishing to see where the true bottlenecks lie. You can spend weeks gaining a 1% performance boost utilizing arcane algorithms when it turns out that a 5-minute tweak could net you a 50% boost.

It will watch your code while it runs, and report back to you with information on which functions took the most time, which functions were called most often, etc. For Scheme, Dr. Racket is an IDE which has a built-in profiler.

Things that are (more) difficult

Read/Write files and file- or folder-traversing

...

User input and sanitising

...

Ports, flags, subscriptions

Footnotes

  1. For example, I wouldn't include anything about ports, decoders, complex types, << operators, and only use simple forms etc. There's really A LOT of explaining and examples needed for intermediate Elm. I'd probably stick to an introductory racket lang and elm lang and focus a lot of time on problem solvers and foundational thinking with a visual touch. Of course lots of books are on beginner subjects and you need a lot of support at the intermediate or "building" stage, but that's far more niche and contextual.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant