-
Notifications
You must be signed in to change notification settings - Fork 1
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
Fixes and updates for use in our Languages API #10
Conversation
- Remove unused import - Use DerivingStrategies throughout
To use BCP47 as a Persist key, we need these instances.
It can be useful to parse BCP47 tags in the context of a larger parser, such as parsing the HTTP Accept-Language Header, which is formatted as {language}[;q={weight}][,...] Doing this on top of fromText is possible, but a bit annoying. NOTE: I attempted to move this to a Data.BCP47.Parser, but the current top-level module contains too many lower-level data definitions for that to be possible without an import-cycle. To address that, we could move most of Data.BCP47 to .Internal modules themselves, and leave Data.BCP47 as a re-export, higher-level interface for the most common usage. This would be a Good Thing, IMO, but has been deferred for now.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍 LGTM
Really not sure what's up on CI:
I can't reproduce it locally. |
Old cache? |
I can try busting it, but it doesn't appear to be that (everything seems to build that I'd expect to build). So I'm afraid if busting it works I might've just papered over something that'll bite someone else later. |
It seems to be this bug: commercialhaskell/stack#5159 "Doctests in multi-package project interfering with each other" I can repro locally (only) with: stack build -j1 bcp47:doctest bcp47-orphans --stack-yaml "stack.yaml" --no-terminal --pedantic --test EDIT: This still doesn't reproduce reliably. Locally it almost always works, and on CI it almost always fails. |
We were incorporating eof into the parser in two places: parser, and complete. These were preventing parser from being usable in the context of something larger (see _example) because the eofs were expected. This required two fixes: 1. Update complete to also end at non-tag characters (not just eof) 2. Move the eof from parser out to fromText fromText is intended to be used on a complete value, so looking for eof here is required. When/if parser is used in the context of a larger parser it can not look for eof.
OK, building the packages independently seems to work around the shared-environment bug. I've cleaned up history (wiping out other failed workarounds), and will merge on Green. |
4e7b147 Updates for newer GHC and --pedantic
DerivingStrategies
throughout414f9ab Fix style in touched files
3e69807 Add HttpApiData orphans
To use
BCP47
as a Persist key, we need these instances.21d5f9e Export parser
It can be useful to parse
BCP47
tags in the context of a larger parser, suchas parsing the HTTP
Accept-Language
Header, which is formatted asDoing this on top of
fromText
is possible, but a bit annoying.NOTE: I attempted to move this to a
Data.BCP47.Parser
, but the currenttop-level module contains too many lower-level data definitions for that to be
possible without an import-cycle. To address that, we could move most of
Data.BCP47
to.Internal
modules themselves, and leaveData.BCP47
as are-export, higher-level interface for the most common usage. This would be a
Good Thing, IMO, but has been deferred for now.