Downsides to disabling unticked-promoted-constructor warning?

Hi! Is there any consensus on unticked promoted constructors -- are they generally safe to use? Currently the warning is part of -Wall, but having promoted constructors unticked is just aesthetically nicer. Thanks, -- Markus Läll

Hi, On 16/10/2021 10:55, Markus Läll wrote:
Is there any consensus on unticked promoted constructors -- are they generally safe to use?
Currently the warning is part of -Wall, but having promoted constructors unticked is just aesthetically nicer.
I don't know if there is a consensus, but I have long been of the opinion that -Wunticked-promoted-constructors should be dropped from -Wall and that GHC should not insert ticks when printing inferred types unless including them is necessary for disambiguation. In particular, as a library author I want to use DataKinds without my users having to know or care what it does. You can sometimes hide the ticks by defining a type synonym, e.g. data T = MkT type MkT = 'MkT but there are cases where GHC exposes the difference still, e.g. if you mention MkT in a class instance head. Cheers, Adam -- Adam Gundry, Haskell Consultant Well-Typed LLP, https://www.well-typed.com/ Registered in England & Wales, OC335890 118 Wymering Mansions, Wymering Road, London W9 2NF, England

As its author, I think -Wunticked-promoted-constructors is a misfeature. It was motivated by the fact that writing [True] when you mean '[True] produces a cascade of obscure kind errors, and so I thought it was good to encourage people to always write the ticks. But the feature does not achieve its goal: because errors squelch warnings, we do not see the warnings if there are any errors. Furthermore, I agree with Adam's post that I've come to prefer a style where we leave off the ticks (where possible). Bottom line: feel free to turn this warning off. Richard
On Oct 16, 2021, at 5:55 AM, Markus Läll
wrote: Hi!
Is there any consensus on unticked promoted constructors -- are they generally safe to use?
Currently the warning is part of -Wall, but having promoted constructors unticked is just aesthetically nicer.
Thanks,
-- Markus Läll _______________________________________________ Haskell-Cafe mailing list To (un)subscribe, modify options or view archives go to: http://mail.haskell.org/cgi-bin/mailman/listinfo/haskell-cafe Only members subscribed via the mailman list are allowed to post.

I've created a ticket to request disabling this warning by default: https://gitlab.haskell.org/ghc/ghc/-/issues/20531 I'm not sure if this needs a full ghc-proposal. Cheers, Adam On 18/10/2021 03:19, Richard Eisenberg wrote:
As its author, I think -Wunticked-promoted-constructors is a misfeature. It was motivated by the fact that writing [True] when you mean '[True] produces a cascade of obscure kind errors, and so I thought it was good to encourage people to always write the ticks. But the feature does not achieve its goal: because errors squelch warnings, we do not see the warnings if there are any errors. Furthermore, I agree with Adam's post that I've come to prefer a style where we leave off the ticks (where possible).
Bottom line: feel free to turn this warning off.
Richard
On Oct 16, 2021, at 5:55 AM, Markus Läll
wrote: Hi!
Is there any consensus on unticked promoted constructors -- are they generally safe to use?
Currently the warning is part of -Wall, but having promoted constructors unticked is just aesthetically nicer.
Thanks,
-- Markus Läll
-- Adam Gundry, Haskell Consultant Well-Typed LLP, https://www.well-typed.com/ Registered in England & Wales, OC335890 118 Wymering Mansions, Wymering Road, London W9 2NF, England

Hi and thank you both!
For disambiguation the tick may be required for syntactically empty and one
element lists, right? As only these can be ambiguous at locations where a
type is expected.
On Wed, Oct 20, 2021 at 3:29 PM Adam Gundry
I've created a ticket to request disabling this warning by default: https://gitlab.haskell.org/ghc/ghc/-/issues/20531
I'm not sure if this needs a full ghc-proposal.
Cheers,
Adam
As its author, I think -Wunticked-promoted-constructors is a misfeature. It was motivated by the fact that writing [True] when you mean '[True]
On 18/10/2021 03:19, Richard Eisenberg wrote: produces a cascade of obscure kind errors, and so I thought it was good to encourage people to always write the ticks. But the feature does not achieve its goal: because errors squelch warnings, we do not see the warnings if there are any errors. Furthermore, I agree with Adam's post that I've come to prefer a style where we leave off the ticks (where possible).
Bottom line: feel free to turn this warning off.
Richard
On Oct 16, 2021, at 5:55 AM, Markus Läll
wrote: Hi!
Is there any consensus on unticked promoted constructors -- are they
generally safe to use?
Currently the warning is part of -Wall, but having promoted
constructors unticked is just aesthetically nicer.
Thanks,
-- Markus Läll
-- Adam Gundry, Haskell Consultant Well-Typed LLP, https://www.well-typed.com/
Registered in England & Wales, OC335890 118 Wymering Mansions, Wymering Road, London W9 2NF, England _______________________________________________ Haskell-Cafe mailing list To (un)subscribe, modify options or view archives go to: http://mail.haskell.org/cgi-bin/mailman/listinfo/haskell-cafe Only members subscribed via the mailman list are allowed to post.
-- Markus Läll

There can also be ambiguities in type families. For example,
data T = T
type family Fam a where
Fam Int = T
Do we have Fam :: Type -> Type or Fam :: Type -> T?
On Thu, Oct 21, 2021, 12:15 PM Markus Läll
Hi and thank you both!
For disambiguation the tick may be required for syntactically empty and one element lists, right? As only these can be ambiguous at locations where a type is expected.
On Wed, Oct 20, 2021 at 3:29 PM Adam Gundry
wrote: I've created a ticket to request disabling this warning by default: https://gitlab.haskell.org/ghc/ghc/-/issues/20531
I'm not sure if this needs a full ghc-proposal.
Cheers,
Adam
As its author, I think -Wunticked-promoted-constructors is a misfeature. It was motivated by the fact that writing [True] when you mean '[True] produces a cascade of obscure kind errors, and so I thought it was good to encourage people to always write the ticks. But the feature does not achieve its goal: because errors squelch warnings, we do not see the warnings if there are any errors. Furthermore, I agree with Adam's post
On 18/10/2021 03:19, Richard Eisenberg wrote: that I've come to prefer a style where we leave off the ticks (where possible).
Bottom line: feel free to turn this warning off.
Richard
On Oct 16, 2021, at 5:55 AM, Markus Läll
wrote:
Hi!
Is there any consensus on unticked promoted constructors -- are they
generally safe to use?
Currently the warning is part of -Wall, but having promoted
constructors unticked is just aesthetically nicer.
Thanks,
-- Markus Läll
-- Adam Gundry, Haskell Consultant Well-Typed LLP, https://www.well-typed.com/
Registered in England & Wales, OC335890 118 Wymering Mansions, Wymering Road, London W9 2NF, England _______________________________________________ Haskell-Cafe mailing list To (un)subscribe, modify options or view archives go to: http://mail.haskell.org/cgi-bin/mailman/listinfo/haskell-cafe Only members subscribed via the mailman list are allowed to post.
-- Markus Läll _______________________________________________ Haskell-Cafe mailing list To (un)subscribe, modify options or view archives go to: http://mail.haskell.org/cgi-bin/mailman/listinfo/haskell-cafe Only members subscribed via the mailman list are allowed to post.
participants (4)
-
Adam Gundry
-
David Feuer
-
Markus Läll
-
Richard Eisenberg