-
Notifications
You must be signed in to change notification settings - Fork 121
Get rid of ImplicitParams to support MicroHs? #462
Description
tasty makes use of {-# LANGUAGE ImplicitParams #-} and not only for internal purposes, but also in the public API such as
tasty/core/Test/Tasty/Ingredients/ConsoleReporter.hs
Lines 443 to 444 in 5bd253b
| -- @since 0.11.3 | |
| printStatistics :: (?colors :: Bool) => Statistics -> Time -> IO () |
Yet according to augustss/MicroHs#352 MicroHs is unlikely to support {-# LANGUAGE ImplicitParams #-}. I'm not a big fan of this extension myself, but even if we were in agreement to rip it off, it cannot be done without breaking the public API and bumping the major version. Which is not exactly the end of the world, but lots of busy work for downstream.
We can potentially comment out implicit parameters when compiled with MicroHs. Not great if in future MicroHs changes the decision and starts supporting them though.
Another option is to add
flag has_implicit_params
default: True and then
if flag(support_implicit_params)
other-extensions: ImplicitParams
cpp-options: -DHasImplicitParamsand then
#ifdef HasImplicitParams
type HasColors = (?colors :: Bool)
#else
type HasColors = ()
#endif This does not hard-code any knowledge about capabilities of MicroHs and ideally Cabal should be able to solve for the flag automatically. If in future MicroHs starts supporting ImplicitParams, all will work out automatically.