The problem as text
My understanding is that NumericUnderscores
is part of the GHC2021
language spec. And yet even if my cabal file sets the default-language
to GHC2021
and includes NumericUnderscores
in default-extensions
, cabal repl
won’t load a module that uses an underscore in a number.
Worse, I can include a nonsense extension in default-extensions
and cabal
doesn’t seem to notice it.
I’m using NixOS and cabal 3.8.1.0.
The problem as a shell transcript
[jeff@jbb-hp17:~/code/music/montevideo]$ cabal --version
cabal-install version 3.8.1.0
compiled using version 3.8.1.0 of the Cabal library
[jeff@jbb-hp17:~/code/music/montevideo]$ grep default-extensions mtv.cabal -A 2
default-extensions:
NumericUnderscores
, A_Nonexistent_Extension
default-language: GHC2021
[jeff@jbb-hp17:~/code/music/montevideo]$ cabal repl
...
Montevideo/Types.hs:10:5: error:
Use NumericUnderscores to allow underscores in integer literals
|
10 | x = 123_456
| ^^^^^^^
Failed, 16 modules loaded.
ghci>