Closed JordanMartinez closed 2 years ago
Bit of an interesting CI error here.
Huh... Yeah it is. I'll look into it.
The failing test is caused by Nate's changes in purescript-parsing
, specifically choice
: https://github.com/purescript-contrib/purescript-parsing/commit/f50e8dd01d09d619a837e502b0c82d5d84a82844#diff-d472726f9da7dc968f3c6ef534ba99b06228789ab00a1f2dfe04eebfde42ffc6L445-R445
Changing this line (https://github.com/purescript-contrib/purescript-formatters/blob/main/src/Data/Formatter/Parser/Interval.purs#L32=) to the following makes the test pass again:
- parseInterval duration date = [ startEnd, durationEnd, startDuration, durationOnly ] <#> PC.try #
+ parseInterval duration date = [ startEnd, durationEnd, startDuration, durationOnly ] <#> PC.try # foldl (<|>) empty
Conceptually, the parse is the same. The difference is what the final parser is and how that affects the error message:
-- choice == foldr (<|>) empty
a <|> b <|> c <|> empty
-- choice == foldl (<|>) empty
empty <|> a <|> b <|> c
@natefaubion I believe you modified choice
because <|>
hadn't yet been made right-associative. Now that it is, should choice
be reverted back to foldl (<|>) empty
?
I think choice should still be right associative. The fact that choice required you to always step through a useless alternative is an odd requirement.
K, I'll update the error message then.
Can I get an approval?
Sorry, I'm not saying that the current error behavior is OK, I'm just saying that I would like to preserve both. I'll need to think about it.
Description of the change
Drops
math
; updates importsChecklist: