You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: content/investigating-language-extension-semantics/index.md
+21-21Lines changed: 21 additions & 21 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,27 +1,27 @@
1
1
+++
2
2
title = "Analyzing language extension semantics"
3
-
date = 2025-11-26
3
+
date = 2025-11-30
4
4
[taxonomies]
5
5
authors = ["Jappie Klooster"]
6
6
categories = ["Haskell Foundation"]
7
7
tags = ["Community", "Stability"]
8
8
+++
9
9
10
10
Hi I'm [Jappie](https://jappie.me) and I volunteer for the [Haskell Foundation Stability Working Group](https://blog.haskell.org/stability-working-group/).
11
-
Recently we analyzed the [head.hackage](https://gitlab.haskell.org/ghc/head.hackage) patches to understand
11
+
Recently we analyzed the [head.hackage](https://gitlab.haskell.org/ghc/head.hackage) patches to understand
12
12
why code breaks on new GHC releases.
13
-
"head.hackage" is a repository of patches for Hackage.
14
-
GHC engineers use these to test out new GHC builds on a wide range of
15
-
Hackage packages without having to upstream[^upstream] a patch, which can take time.
16
-
Instead, they can put the patch in "head.hackage"
13
+
"head.hackage" is a repository of patches for Hackage.
14
+
GHC engineers use these to test out new GHC builds on a wide range of
15
+
Hackage packages without having to upstream[^upstream] a patch, which can take time.
16
+
Instead, they can put the patch in "head.hackage"
17
17
and immediately test it on a wide range of packages.
it came from deeper semantic changes in language extensions.
21
21
The meaning of (some) language extensions changed between GHC releases.
22
-
This post walks through the main categories of breakage,
22
+
This post walks through the main categories of breakage,
23
23
why they happened, and what they tell us about long-term stability.
24
-
If you care about a smoother upgrade path for Haskell users,
24
+
If you care about a smoother upgrade path for Haskell users,
25
25
we invite you to participate in the [Haskell Foundation Stability Working Group](https://blog.haskell.org/stability-working-group/).
26
26
27
27
@@ -71,15 +71,15 @@ to do this under certain existential conditions:
71
71
```
72
72
73
73
You have to insert a lambda, which apparently has some performance impact.
74
-
This had a big impact on [Yesod stacks](https://www.yesodweb.com/book),
75
-
whose code generation helpfully created
74
+
This had a big impact on [Yesod stacks](https://www.yesodweb.com/book),
75
+
whose code generation helpfully created
76
76
the database alias in the template:
77
77
```haskell
78
78
typeDBa=forall (m::Type->Type).
79
79
(MonadUnliftIOm) =>ReaderTSqlBackendma
80
80
```
81
81
82
-
Normally this is quite convenient,
82
+
Normally this is quite convenient,
83
83
however with the simplified subsumption change,
84
84
any code that interacts with the database now has to insert those lambdas.
85
85
As you can imagine this would in many places for a commercial code base.
@@ -101,15 +101,15 @@ So the community is better off, despite this causing a fair bit of work.
101
101
```diff
102
102
--- a/src/Ipe/Content.hs
103
103
+++ b/src/Ipe/Content.hs
104
-
@@-288,6+288,14@@
105
-
104
+
@@-288,6+288,14@@
105
+
106
106
+instance Fractional r =>IsTransformable (IpeObject r) where
107
107
+ transformBy t (IpeGroup i) =IpeGroup$ i&core %~ transformBy t
108
108
+...
109
109
makePrisms ''IpeObject
110
-
111
-
@@-303,14+311,6@@
112
-
110
+
111
+
@@-303,14+311,6@@
112
+
113
113
-instance Fractional r =>IsTransformable (IpeObject r) where
114
114
- transformBy t (IpeGroup i) =IpeGroup$ i&core %~ transformBy t
115
115
-...
@@ -118,7 +118,7 @@ So the community is better off, despite this causing a fair bit of work.
118
118
## (1) Parser change
119
119
120
120
The parser is the component of the compiler that transforms text
121
-
into a memory structure the compiler can work with.
121
+
into a memory structure the compiler can work with.
122
122
This structure is called an abstract syntax tree.
123
123
124
124
```diff
@@ -140,7 +140,7 @@ disallowing `!` before parens.
140
140
Here the bang `!` indicates strict fields.
141
141
Technically this doesn't fit into the category
142
142
because the core language isn't a language extension.
143
-
But semantics did change!
143
+
But semantics did change!
144
144
Actually I don't think we expected to find something like this at all.
145
145
I'm not sure how relevant this is to discuss further because it appears
146
146
quite rare for someone to do this.
@@ -170,7 +170,7 @@ is that part of the syntax for type abstractions landed in GHC 9.2,
170
170
however 9.8 and onwards requires you to enable this language extension.
171
171
This appeared because certain new functionality was introduced behind an
172
172
old language extension flag, according to [this proposal](https://github.com/ghc-proposals/ghc-proposals/blob/master/proposals/0448-type-variable-scoping.rst#4type-arguments-in-constructor-patterns). It says we don't want to introduce new functionality behind established extensions,
173
-
so that's why we require TypeAbstractions now,
173
+
so that's why we require TypeAbstractions now,
174
174
where previously ScopedTypeVariables and TypeApplications were enough.
175
175
176
176
This extension enables you to bind type variables in pattern matches.
@@ -189,7 +189,7 @@ I don't know why this happened like this, but it happened in 2023:
189
189
```
190
190
191
191
## (4) Star is type
192
-
This change was announced via a warning.
192
+
This change was announced via a warning.
193
193
It tells users to write `Type` instead of `*` for kinds representing types.
194
194
A kind is essentially the type of a type,
195
195
and as a concept is used for type-level programming type safety.
0 commit comments