Conversation
Papipo
left a comment
There was a problem hiding this comment.
I think the builder pattern as an alternative to the non-existing optional arguments would be an interesting addition. Emphasis on "optional arguments" because that's what newbies will look for.
|
Sorry, I have just realised this is a draft. I caught a typo so I hope it's still welcome 😅 |
|
I saw the "make invalid states impossible" as a TODO section, and dropping in FYI some resources I have in my stashed browser tabs. First one "On making impossible states impossible is by Rasmus Larsson specifically on Gleam, and the 2nd article "Making Impossible States Impossible: Type-Safe Domain Modeling with Functional Dependency Injection by Christian Ekrem relates to Elm and F#. For me the excellent video by Scott Wlaschin was the absolute eye-opener on the usefulness of this pattern. |
| let likely_generated = | ||
| // In newer versions of squirrel this is always at the beginning of the | ||
| // file and it would be enough to check for this comment to establish if | ||
| // a file is generated or not... | ||
| string.contains( | ||
| content, | ||
| "> 🐿️ This module was generated automatically using", | ||
| ) | ||
| // ...but in older versions that module comment is not present! So we | ||
| // need to check if there's any function generated by squirrel. | ||
| || string.contains( | ||
| content, | ||
| "> 🐿️ This function was generated automatically using", | ||
| ) |
There was a problem hiding this comment.
Honoured to be part of the examples 💖
No description provided.