[Haskell-cafe] Downsides to disabling unticked-promoted-constructor warning?
adam at well-typed.com
Sat Oct 16 21:57:11 UTC 2021
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.
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
More information about the Haskell-Cafe