Comments (4)
Let's simply deactivate -Wunticked-promoted-constructors
for all GHC versions?
from servant.
Let's simply deactivate -Wunticked-promoted-constructors for all GHC versions?
I don't think this works. The issue is not caused by warnings, but it is caused by types in error messages not having the tick as they previously had. To verify this, I added -Wunticked-promoted-constructors
to the test-suite
of servant-server
, and reran the doctest. I still get the failures. I suspect I'd be another flag we'd need to set for older GHCs, one about formatting errors. And I am not sure that exists, since the change of heart on unticked promoted constructors might not have been anticipated such that it'd be available in all the GHC versions we run the doctests for.
Solutions I can think of:
- Only run doctests on GHC <9.6: This would mean keeping the existing ticks in the code
- Only run doctests on GHC >=9.6: This would mean adapting the code to pass the current failing tests, e.g. replacing
Verb 'GET
withVerb GET
. - Duplicating the test:
-- | This instance prevents from accidentally using '->' instead of ':>' -- #if __GLASGOW_HASKELL__ >= 906 -- >>> serve (Proxy :: Proxy (Capture "foo" Int -> Get '[JSON] Int)) (error "...") -- ... -- ...No instance HasServer (a -> b). -- ...Maybe you have used '->' instead of ':>' between -- ...Capture' '[] "foo" Int -- ...and -- ...Verb GET 200 [JSON] Int -- ... #else -- >>> serve (Proxy :: Proxy (Capture "foo" Int -> Get '[JSON] Int)) (error "...") -- ... -- ...No instance HasServer (a -> b). -- ...Maybe you have used '->' instead of ':>' between -- ...Capture' '[] "foo" Int -- ...and -- ...Verb 'GET 200 '[JSON] Int -- ... #endif
from servant.
We could also add -fprint-redundant-promotion-ticks
to have GHC print it in the old style.
from servant.
@voidus Thank you! I have added the flag in #1680 . I would appreciate a review if you have time.
from servant.
Related Issues (20)
- Avoid duplicate instances when using ToServantApi HOT 2
- UTCTime in url results in 'not found' error HOT 2
- GHC 9.6.1 fails to build servant HOT 12
- servant-client doesn't handle multiple Set-Cookie headers correctly HOT 1
- haddock documentation link in readme is broken HOT 2
- Can the lastest servant-auth be released? HOT 5
- Support using the names from named routes in `servant-foreign`
- Making query parameters optionals in allLinks/safeLink with `NamedRoute`s
- Build without warnings? HOT 3
- servant-client is working fine when hitting http2 calls locally but when we try to hit it for external calls it's giving 505 HTTP Version Not Supported
- Text-2.0 support HOT 1
- Building a project fails - missing module Data.Aeson.Parser HOT 3
- servant-auth-client test fails on the 248th call to getIntClient on Mac HOT 3
- monadic `hoistServerM`? HOT 1
- Docs on "Record-based APIs: the nested records case" not in main branch HOT 3
- servant-auth-server: Too strict bounds on lens-aeson HOT 2
- servant-foreign: too strict bounds on hspec HOT 2
- Question: How to restrict an API to a particular virtual host (value of the request "Host:" header)? HOT 1
- Make JWKSettings signingKey optional HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from servant.