<feed xmlns='http://www.w3.org/2005/Atom'>
<title>delta/haskell.git/utils, branch wip/stringbuffer</title>
<subtitle>gitlab.haskell.org: ghc/ghc.git
</subtitle>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/haskell.git/'/>
<entry>
<title>StringBuffer: Rid it of ForeignPtrs</title>
<updated>2020-11-29T23:26:15+00:00</updated>
<author>
<name>Ben Gamari</name>
<email>ben@smart-cactus.org</email>
</author>
<published>2020-10-23T18:16:58+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/haskell.git/commit/?id=b3027eb0a1c1b3cedbb54b0fc8d0924283a7cd25'/>
<id>b3027eb0a1c1b3cedbb54b0fc8d0924283a7cd25</id>
<content type='text'>
Bumps haddock submodule.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Bumps haddock submodule.
</pre>
</div>
</content>
</entry>
<entry>
<title>Bump time submodule to 1.11.1</title>
<updated>2020-11-22T17:39:02+00:00</updated>
<author>
<name>Ben Gamari</name>
<email>ben@smart-cactus.org</email>
</author>
<published>2020-10-27T14:34:59+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/haskell.git/commit/?id=901bc2208a115e0f8313b3aa9abc76fd05509aaa'/>
<id>901bc2208a115e0f8313b3aa9abc76fd05509aaa</id>
<content type='text'>
Also bumps directory, Cabal, hpc, time, and unix submodules.

Closes #18847.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Also bumps directory, Cabal, hpc, time, and unix submodules.

Closes #18847.
</pre>
</div>
</content>
</entry>
<entry>
<title>Move Plugins into HscEnv (#17957)</title>
<updated>2020-11-21T06:14:09+00:00</updated>
<author>
<name>Sylvain Henry</name>
<email>sylvain@haskus.fr</email>
</author>
<published>2020-11-03T11:04:53+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/haskell.git/commit/?id=ecfd0278cb811c93853c176fe5df60222d1a8fb5'/>
<id>ecfd0278cb811c93853c176fe5df60222d1a8fb5</id>
<content type='text'>
Loaded plugins have nothing to do in DynFlags so this patch moves them
into HscEnv (session state).

"DynFlags plugins" become "Driver plugins" to still be able to register
static plugins.

Bump haddock submodule
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Loaded plugins have nothing to do in DynFlags so this patch moves them
into HscEnv (session state).

"DynFlags plugins" become "Driver plugins" to still be able to register
static plugins.

Bump haddock submodule
</pre>
</div>
</content>
</entry>
<entry>
<title>AArch64/arm64 adjustments</title>
<updated>2020-11-15T08:36:56+00:00</updated>
<author>
<name>Moritz Angermann</name>
<email>moritz.angermann@gmail.com</email>
</author>
<published>2020-11-13T02:51:54+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/haskell.git/commit/?id=8887102fc4ed8ed1089c1aafd19bab424ad706f3'/>
<id>8887102fc4ed8ed1089c1aafd19bab424ad706f3</id>
<content type='text'>
This addes the necessary logic to support aarch64 on elf, as well
as aarch64 on mach-o, which Apple calls arm64.

We change architecture name to AArch64, which is the official arm
naming scheme.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This addes the necessary logic to support aarch64 on elf, as well
as aarch64 on mach-o, which Apple calls arm64.

We change architecture name to AArch64, which is the official arm
naming scheme.
</pre>
</div>
</content>
</entry>
<entry>
<title>Use tcSplitForAllInvisTyVars (not tcSplitForAllTyVars) in more places</title>
<updated>2020-11-15T08:36:21+00:00</updated>
<author>
<name>Ryan Scott</name>
<email>ryan.gl.scott@gmail.com</email>
</author>
<published>2020-11-13T15:56:20+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/haskell.git/commit/?id=645444af9eb185684c750c95e4740d301352b2b9'/>
<id>645444af9eb185684c750c95e4740d301352b2b9</id>
<content type='text'>
The use of `tcSplitForAllTyVars` in `tcDataFamInstHeader` was the immediate
cause of #18939, and replacing it with a new `tcSplitForAllInvisTyVars`
function (which behaves like `tcSplitForAllTyVars` but only splits invisible
type variables) fixes the issue. However, this led me to realize that _most_
uses of `tcSplitForAllTyVars` in GHC really ought to be
`tcSplitForAllInvisTyVars` instead. While I was in town, I opted to replace
most uses of `tcSplitForAllTys` with `tcSplitForAllTysInvis` to reduce the
likelihood of such bugs in the future.

I say "most uses" above since there is one notable place where we _do_ want
to use `tcSplitForAllTyVars`: in `GHC.Tc.Validity.forAllTyErr`, which produces
the "`Illegal polymorphic type`" error message if you try to use a higher-rank
`forall` without having `RankNTypes` enabled. Here, we really do want to split
all `forall`s, not just invisible ones, or we run the risk of giving an
inaccurate error message in the newly added `T18939_Fail` test case.

I debated at some length whether I wanted to name the new function
`tcSplitForAllInvisTyVars` or `tcSplitForAllTyVarsInvisible`, but in the end,
I decided that I liked the former better. For consistency's sake, I opted to
rename the existing `splitPiTysInvisible` and `splitPiTysInvisibleN` functions
to `splitInvisPiTys` and `splitPiTysInvisN`, respectively, so that they use the
same naming convention. As a consequence, this ended up requiring a `haddock`
submodule bump.

Fixes #18939.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
The use of `tcSplitForAllTyVars` in `tcDataFamInstHeader` was the immediate
cause of #18939, and replacing it with a new `tcSplitForAllInvisTyVars`
function (which behaves like `tcSplitForAllTyVars` but only splits invisible
type variables) fixes the issue. However, this led me to realize that _most_
uses of `tcSplitForAllTyVars` in GHC really ought to be
`tcSplitForAllInvisTyVars` instead. While I was in town, I opted to replace
most uses of `tcSplitForAllTys` with `tcSplitForAllTysInvis` to reduce the
likelihood of such bugs in the future.

I say "most uses" above since there is one notable place where we _do_ want
to use `tcSplitForAllTyVars`: in `GHC.Tc.Validity.forAllTyErr`, which produces
the "`Illegal polymorphic type`" error message if you try to use a higher-rank
`forall` without having `RankNTypes` enabled. Here, we really do want to split
all `forall`s, not just invisible ones, or we run the risk of giving an
inaccurate error message in the newly added `T18939_Fail` test case.

I debated at some length whether I wanted to name the new function
`tcSplitForAllInvisTyVars` or `tcSplitForAllTyVarsInvisible`, but in the end,
I decided that I liked the former better. For consistency's sake, I opted to
rename the existing `splitPiTysInvisible` and `splitPiTysInvisibleN` functions
to `splitInvisPiTys` and `splitPiTysInvisN`, respectively, so that they use the
same naming convention. As a consequence, this ended up requiring a `haddock`
submodule bump.

Fixes #18939.
</pre>
</div>
</content>
</entry>
<entry>
<title>Fix haddock submodule</title>
<updated>2020-11-08T17:08:40+00:00</updated>
<author>
<name>Ben Gamari</name>
<email>ben@smart-cactus.org</email>
</author>
<published>2020-11-08T17:08:40+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/haskell.git/commit/?id=22888798d224f96202480595fc49bc5c4b2f8328'/>
<id>22888798d224f96202480595fc49bc5c4b2f8328</id>
<content type='text'>
The previous merge mistakenly reverted it.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
The previous merge mistakenly reverted it.
</pre>
</div>
</content>
</entry>
<entry>
<title>Merge remote-tracking branch 'origin/wip/tsan/all'</title>
<updated>2020-11-08T14:29:16+00:00</updated>
<author>
<name>Ben Gamari</name>
<email>ben@smart-cactus.org</email>
</author>
<published>2020-11-08T14:29:16+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/haskell.git/commit/?id=638f38c50e80a19275f3a06535a0dd8130a17a53'/>
<id>638f38c50e80a19275f3a06535a0dd8130a17a53</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>Replace HsImplicitBndrs with HsOuterTyVarBndrs</title>
<updated>2020-11-06T08:45:28+00:00</updated>
<author>
<name>Ryan Scott</name>
<email>ryan.gl.scott@gmail.com</email>
</author>
<published>2020-07-05T20:15:01+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/haskell.git/commit/?id=e07e383a3250cb27a9128ad8d5c68def5c3df336'/>
<id>e07e383a3250cb27a9128ad8d5c68def5c3df336</id>
<content type='text'>
This refactors the GHC AST to remove `HsImplicitBndrs` and replace it with
`HsOuterTyVarBndrs`, a type which records whether the outermost quantification
in a type is explicit (i.e., with an outermost, invisible `forall`) or
implicit. As a result of this refactoring, it is now evident in the AST where
the `forall`-or-nothing rule applies: it's all the places that use
`HsOuterTyVarBndrs`. See the revamped `Note [forall-or-nothing rule]` in
`GHC.Hs.Type` (previously in `GHC.Rename.HsType`).

Moreover, the places where `ScopedTypeVariables` brings lexically scoped type
variables into scope are a subset of the places that adhere to the
`forall`-or-nothing rule, so this also makes places that interact with
`ScopedTypeVariables` easier to find. See the revamped
`Note [Lexically scoped type variables]` in `GHC.Hs.Type` (previously in
`GHC.Tc.Gen.Sig`).

`HsOuterTyVarBndrs` are used in type signatures (see `HsOuterSigTyVarBndrs`)
and type family equations (see `HsOuterFamEqnTyVarBndrs`). The main difference
between the former and the latter is that the former cares about specificity
but the latter does not.

There are a number of knock-on consequences:

* There is now a dedicated `HsSigType` type, which is the combination of
  `HsOuterSigTyVarBndrs` and `HsType`. `LHsSigType` is now an alias for an
  `XRec` of `HsSigType`.
* Working out the details led us to a substantial refactoring of
  the handling of explicit (user-written) and implicit type-variable
  bindings in `GHC.Tc.Gen.HsType`.

  Instead of a confusing family of higher order functions, we now
  have a local data type, `SkolemInfo`, that controls how these
  binders are kind-checked.

  It remains very fiddly, not fully satisfying. But it's better
  than it was.

Fixes #16762. Bumps the Haddock submodule.

Co-authored-by: Simon Peyton Jones &lt;simonpj@microsoft.com&gt;
Co-authored-by: Richard Eisenberg &lt;rae@richarde.dev&gt;
Co-authored-by: Zubin Duggal &lt;zubin@cmi.ac.in&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This refactors the GHC AST to remove `HsImplicitBndrs` and replace it with
`HsOuterTyVarBndrs`, a type which records whether the outermost quantification
in a type is explicit (i.e., with an outermost, invisible `forall`) or
implicit. As a result of this refactoring, it is now evident in the AST where
the `forall`-or-nothing rule applies: it's all the places that use
`HsOuterTyVarBndrs`. See the revamped `Note [forall-or-nothing rule]` in
`GHC.Hs.Type` (previously in `GHC.Rename.HsType`).

Moreover, the places where `ScopedTypeVariables` brings lexically scoped type
variables into scope are a subset of the places that adhere to the
`forall`-or-nothing rule, so this also makes places that interact with
`ScopedTypeVariables` easier to find. See the revamped
`Note [Lexically scoped type variables]` in `GHC.Hs.Type` (previously in
`GHC.Tc.Gen.Sig`).

`HsOuterTyVarBndrs` are used in type signatures (see `HsOuterSigTyVarBndrs`)
and type family equations (see `HsOuterFamEqnTyVarBndrs`). The main difference
between the former and the latter is that the former cares about specificity
but the latter does not.

There are a number of knock-on consequences:

* There is now a dedicated `HsSigType` type, which is the combination of
  `HsOuterSigTyVarBndrs` and `HsType`. `LHsSigType` is now an alias for an
  `XRec` of `HsSigType`.
* Working out the details led us to a substantial refactoring of
  the handling of explicit (user-written) and implicit type-variable
  bindings in `GHC.Tc.Gen.HsType`.

  Instead of a confusing family of higher order functions, we now
  have a local data type, `SkolemInfo`, that controls how these
  binders are kind-checked.

  It remains very fiddly, not fully satisfying. But it's better
  than it was.

Fixes #16762. Bumps the Haddock submodule.

Co-authored-by: Simon Peyton Jones &lt;simonpj@microsoft.com&gt;
Co-authored-by: Richard Eisenberg &lt;rae@richarde.dev&gt;
Co-authored-by: Zubin Duggal &lt;zubin@cmi.ac.in&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>primops: Generate ByteArray# index/read/write primops</title>
<updated>2020-10-31T06:55:10+00:00</updated>
<author>
<name>Ben Gamari</name>
<email>ben@smart-cactus.org</email>
</author>
<published>2020-10-29T18:11:35+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/haskell.git/commit/?id=b4278a41a18132a981b25c59b296cdf3ba970024'/>
<id>b4278a41a18132a981b25c59b296cdf3ba970024</id>
<content type='text'>
Previously these were mostly undocumented and was ripe for potential
inconsistencies.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Previously these were mostly undocumented and was ripe for potential
inconsistencies.
</pre>
</div>
</content>
</entry>
<entry>
<title>Split HsConDecl{H98,GADT}Details</title>
<updated>2020-10-30T22:52:50+00:00</updated>
<author>
<name>Ryan Scott</name>
<email>ryan.gl.scott@gmail.com</email>
</author>
<published>2020-10-24T14:39:50+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/haskell.git/commit/?id=31fcb55f4ff8c06c5ab100a6817cae8b571295a9'/>
<id>31fcb55f4ff8c06c5ab100a6817cae8b571295a9</id>
<content type='text'>
Haskell98 and GADT constructors both use `HsConDeclDetails`, which includes
`InfixCon`. But `InfixCon` is never used for GADT constructors, which results
in an awkward unrepresentable state. This removes the unrepresentable state by:

* Renaming the existing `HsConDeclDetails` synonym to `HsConDeclH98Details`,
  which emphasizes the fact that it is now only used for Haskell98-style data
  constructors, and
* Creating a new `HsConDeclGADTDetails` data type with `PrefixConGADT` and
  `RecConGADT` constructors that closely resemble `PrefixCon` and `InfixCon`
  in `HsConDeclH98Details`. The key difference is that `HsConDeclGADTDetails`
  lacks any way to represent infix constructors.

The rest of the patch is refactoring to accommodate the new structure of
`HsConDecl{H98,GADT}Details`. Some highlights:

* The `getConArgs` and `hsConDeclArgTys` functions have been removed, as
  there is no way to implement these functions uniformly for all
  `ConDecl`s. For the most part, their previous call sites now
  pattern match on the `ConDecl`s directly and do different things for
  `ConDeclH98`s and `ConDeclGADT`s.

  I did introduce one new function to make the transition easier:
  `getRecConArgs_maybe`, which extracts the arguments from a `RecCon(GADT)`.
  This is still possible since `RecCon(GADT)`s still use the same representation
  in both `HsConDeclH98Details` and `HsConDeclGADTDetails`, and since the
  pattern that `getRecConArgs_maybe` implements is used in several places,
  I thought it worthwhile to factor it out into its own function.
* Previously, the `con_args` fields in `ConDeclH98` and `ConDeclGADT` were
  both of type `HsConDeclDetails`. Now, the former is of type
  `HsConDeclH98Details`, and the latter is of type `HsConDeclGADTDetails`,
  which are distinct types. As a result, I had to rename the `con_args` field
  in `ConDeclGADT` to `con_g_args` to make it typecheck.

  A consequence of all this is that the `con_args` field is now partial, so
  using `con_args` as a top-level field selector is dangerous. (Indeed, Haddock
  was using `con_args` at the top-level, which caused it to crash at runtime
  before I noticed what was wrong!) I decided to add a disclaimer in the 9.2.1
  release notes to advertise this pitfall.

Fixes #18844. Bumps the `haddock` submodule.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Haskell98 and GADT constructors both use `HsConDeclDetails`, which includes
`InfixCon`. But `InfixCon` is never used for GADT constructors, which results
in an awkward unrepresentable state. This removes the unrepresentable state by:

* Renaming the existing `HsConDeclDetails` synonym to `HsConDeclH98Details`,
  which emphasizes the fact that it is now only used for Haskell98-style data
  constructors, and
* Creating a new `HsConDeclGADTDetails` data type with `PrefixConGADT` and
  `RecConGADT` constructors that closely resemble `PrefixCon` and `InfixCon`
  in `HsConDeclH98Details`. The key difference is that `HsConDeclGADTDetails`
  lacks any way to represent infix constructors.

The rest of the patch is refactoring to accommodate the new structure of
`HsConDecl{H98,GADT}Details`. Some highlights:

* The `getConArgs` and `hsConDeclArgTys` functions have been removed, as
  there is no way to implement these functions uniformly for all
  `ConDecl`s. For the most part, their previous call sites now
  pattern match on the `ConDecl`s directly and do different things for
  `ConDeclH98`s and `ConDeclGADT`s.

  I did introduce one new function to make the transition easier:
  `getRecConArgs_maybe`, which extracts the arguments from a `RecCon(GADT)`.
  This is still possible since `RecCon(GADT)`s still use the same representation
  in both `HsConDeclH98Details` and `HsConDeclGADTDetails`, and since the
  pattern that `getRecConArgs_maybe` implements is used in several places,
  I thought it worthwhile to factor it out into its own function.
* Previously, the `con_args` fields in `ConDeclH98` and `ConDeclGADT` were
  both of type `HsConDeclDetails`. Now, the former is of type
  `HsConDeclH98Details`, and the latter is of type `HsConDeclGADTDetails`,
  which are distinct types. As a result, I had to rename the `con_args` field
  in `ConDeclGADT` to `con_g_args` to make it typecheck.

  A consequence of all this is that the `con_args` field is now partial, so
  using `con_args` as a top-level field selector is dangerous. (Indeed, Haddock
  was using `con_args` at the top-level, which caused it to crash at runtime
  before I noticed what was wrong!) I decided to add a disclaimer in the 9.2.1
  release notes to advertise this pitfall.

Fixes #18844. Bumps the `haddock` submodule.
</pre>
</div>
</content>
</entry>
</feed>
