diff --git a/cabal-dev-scripts/src/GenUtils.hs b/cabal-dev-scripts/src/GenUtils.hs index 7d7b39c2add..c47b34df92f 100644 --- a/cabal-dev-scripts/src/GenUtils.hs +++ b/cabal-dev-scripts/src/GenUtils.hs @@ -15,6 +15,7 @@ import Data.Text (Text) import GHC.Generics (Generic) import qualified Data.Algorithm.Diff as Diff +import qualified Data.Char as C import qualified Data.Map as Map import qualified Data.Set as Set import qualified Data.Text as T @@ -160,9 +161,10 @@ toConstructorName t = t f c = c special :: Text -> Text - special "0BSD" = "NullBSD" - special "389_exception" = "DS389_exception" - special u = u + special u + | Just (c, _) <- T.uncons u + , C.isDigit c = "NN_" <> u + special u = u mkList :: [Text] -> Text mkList [] = " []" diff --git a/changelog.d/pr-10356 b/changelog.d/pr-10356 new file mode 100644 index 00000000000..5c73e4fdbf6 --- /dev/null +++ b/changelog.d/pr-10356 @@ -0,0 +1,11 @@ +synopsis: New licence constructors for SPDX licences starting with a digit +packages: Cabal-syntax +prs: #10356 + +description: { + +- LicenseId constructor `NullBSD` is now `NN_0BSD`. +- LicenseId constructor `DS389_exception` is now and `NN_389_exception`. +- LicenseId constructor `X3D_Slicer_1_0` is now and `NN_3D_Slicer_1_0`. + +}