diff --git a/feed.xml b/feed.xml index bf57b95..a289588 100644 --- a/feed.xml +++ b/feed.xml @@ -3,7 +3,7 @@ lue blog lue's thoughts https://lue-bird.github.io/blog/ -Mon, 23 Oct 2023 13:25:05 +0000 +Tue, 14 Nov 2023 00:29:57 +0000 dillonkearns/elm-rss Your AST allows lists with different element types. Why? @@ -279,7 +279,9 @@ type EqualsExpression = EqualsOfInt (EqualsOf Int) | EqualsOfExpression (EqualsOf EqualsExpression) | EqualsOfTuple { firsts : EqualsExpression, seconds : EqualsExpression } - | EqualsOfTriple { firsts : EqualsExpression, seconds : EqualsExpression, thirds : EqualsExpression }</code></pre><p>Wtf?</p></div></section>]]> + | EqualsOfTriple { firsts : EqualsExpression, seconds : EqualsExpression, thirds : EqualsExpression } + -- even records! + | EqualsOfRecord (Dict String EqualsExpression)</code></pre><p>Wtf?</p></div></section>]]> Wrapping wrappers safely: typed-value 8.0.0 diff --git a/src/Articles.elm b/src/Articles.elm index f0c7965..b1e00e2 100644 --- a/src/Articles.elm +++ b/src/Articles.elm @@ -115,7 +115,36 @@ whatToDoWithElmReviewErrorsArticle = Sequence [ textOnlyParagraph """Ever wanted to add helpers but introducing them at once would start a chain reaction of refactors? Especially when the new helper will make existing helpers irrelevant, it can feel simplest to just get the big refactor done with.""" - , textOnlyParagraph """If you feel like this (just like past and sometimes current lue), here's an alternative to try:""" + , elmCode """ +isNotFunction : Expression -> Bool +isNotFunction expression = + case expression of + Expression.Variable ( "Basics", "not" ) -> + True + + _ -> + False + +isNegateFunction : Expression -> Bool +isNegateFunction expression = + case expression of + Expression.Variable ( "Basics", "negate" ) -> + True + + _ -> + False +""" + , Paragraph [ Text "and you want to add" ] + , elmCode """ +isSpecificVariable specificFullyQualifiedVariableName = + case expression of + Expression.Variable fullyQualifiedVariableName -> + fullyQualifiedVariableName == specificFullyQualifiedVariableName + + _ -> + False +""" + , Paragraph [ Text "If you feel like this (just like past and sometimes current lue), here's an alternative to try:" ] , Paragraph [ Text "Do a small, local, immediate step. " , Italic "Commit" @@ -161,6 +190,8 @@ You know, the stuff that allows you to keep less things in your mind that "you s , textOnlyParagraph """If you think there won't be an automated error for something on the way, make it a new item in a todo list. Aggregating errors isn't scary. They have your back.""" , textOnlyParagraph """TODO: Show step-by-step refactor of adding helper, adding @deprecated, fixing the issues one by one""" + , textOnlyParagraph """If possible I'd like if elm-review doesn't slow this exploration phase... +→ Also, elm-review rules don't really "slow down development" because they just hint at and remind you of what's left to do eventually without forcing you to do anything. (e.g. you added this helper? Do your thing but I always have your back so you don't forget that you wanted to use this helper somewhere) TODO integrate""" ] } @@ -578,6 +609,8 @@ type EqualsExpression | EqualsOfExpression (EqualsOf EqualsExpression) | EqualsOfTuple { firsts : EqualsExpression, seconds : EqualsExpression } | EqualsOfTriple { firsts : EqualsExpression, seconds : EqualsExpression, thirds : EqualsExpression } + -- even records! + | EqualsOfRecord (Dict String EqualsExpression) """ , textOnlyParagraph """Wtf?""" ]