GHC 9.12 & Cabal 3.14 releases
Hécate January 06, 2025 [Cabal, GHC] #ReleaseTo conclude the year 2024, the GHC and Cabal teams are happy to announce the releases of GHC 9.12 and cabal 3.14.
Here are some highlights:
GHC 9.12
Language Extensions
This release brings many new and exciting extensions:
- Multiline string literals to write string literals with newlines kept verbatim, enabling multiline strings without the need for string gaps and literal \n characters";
- Or-Patterns, allowing you to match on several patterns in a single
case
branch:
data Sweet = Cupcake | Liquorice | Cookie | Raisins
-- Without Or-Patterns
tasty Cupcake = True
tasty Cookie = True
tasty _ = False
-- With Or-Patterns
tasty (Cupcake; Cookie) = True
tasty (Liquorice; Raisins) = False
- NamedDefaults allows you to create type defaulting declarations for literals other than for the
Num
class. This mechanism is used to make sure that in the expressionprint (6 + 7)
, the multiplication gets a concrete type likeInteger
,Int
orDouble
, instead of the vagueNum a => a
.
You can now apply this mechanism to other typeclasses, like:
default IsString (Text, String)
Which means that in a module with OverloadedStrings
, string literals "like this"
will default to Text
instead of triggering an error about a polymorphic type.
Base Library
- Improvements to backtraces and exceptions. Lots of them.
⚠️ Deprecations
- The deprecation cycle of GHC.Pack has reached its conclusion and the module has been removed.
- GHC.Desugar will be removed in GHC 9.14.
Code Generation
- Experimental support for the RISC-V Platform;
- SIMD! On x86, most floating-point operations and some integer vector operations are supported for 128-bit vectors without requiring LLVM. Get in touch to help with this effort
- You can try the new experimental
-fobject-determinism
flag to enable deterministic object code generation.
⚠️ Deprecations
- Support 32-bit Windows & macOS/iOS has been dropped;
- As a result, the
stdcall
calling convention for FFI has been dropped,ccall
should be used instead.
You can read the full release notes here.
Cabal 3.14
New things
-
(Spec v3.14 only) New field:
extra-files
allows you to bundle files in the source distribution (sdist) of your cabal package. It serves as an alternative when the files you want to bundle do not fit in the existingdata-files
(for runtime data),extra-source-files
(built by cabal) orextra-doc-files
(shipped with Haddocks). This field has no inherent meaning, to avoid misuse of the already existing fields. For instance, you can useextra-files
to shipstack.yaml
files, which are not used either by the program at run-time, nor by Cabal or Haddock. -
You can now compile projects dynamically with profiling enabled. The following options are now available:
- cabal.project:
profiling-shared: <Boolean>
; - cabal file:
ghc-prof-shared-options
for passing options when building in profiling dynamic way; - Command-line arguments:
--enable-profiling --enable-executable-dynamic
.
- cabal.project:
-
New GHC options and extensions are supported.
-
New build type: Hooks. This build type, intended to eventually replace the Custom build type, integrates better with the rest of the ecosystem (cabal-install, Haskell Language Server).
-
The experimental
haddock-project
command supports sub-components.
Changed
-
cabal init
remembers the chosen language within current session (Haskell2010
,GHC2021
, etc.). -
cabal check
will raise an error about the insecuregit://
protocol insource-repository
. -
Enable recompilation avoidance during Haddock generation.
-
Clarify error message when
pkg-config
is not found. -
Print out which project file(s) we are using.
Fixed
-
The
--promised-dependency
flag now accepts the version of a package in the package name. Previously you could only call it with an argument likevoid=void-0.5.8
. Now, it is possible to write:--promised-dependency=void-0.5.8=void-0.5.8
. -
Always pass
ghc-options
to GHC. -
Enhance error detection for cabal root project files, including broken symlinks.
-
Don't pass
--coverage-for
for non-dependency libs of a testsuite. -
Fix a bug that causes
cabal init
to crash ifgit
is not installed.
Unresolved
- Recompilation avoidance during Haddock generation sometimes does not work on Windows (haskell/cabal#9177).
You can see the full changelogs for Cabal & Cabal-syntax, and for cabal-install and cabal-install-solver
As always, the Cabal team is always welcoming of new contributors. We have a nice back catalogue of bugs, oddities and feature requests. Stop by our matrix channel!