# Serokell’s Work on GHC: Dependent Types, Part 2

**URL:** <https://discourse.haskell.org/t/serokell-s-work-on-ghc-dependent-types-part-2/8379>\
**Category:** Links\
**Created:** [December 22, 2023, 8:37pm UTC](https://discourse.haskell.org/t/serokell-s-work-on-ghc-dependent-types-part-2/8379 "2023-12-22T20:37:13Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![scholablade](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.haskell.org/scholablade/32/3575_2.png) [@scholablade](https://discourse.haskell.org/u/scholablade)\
**Post date:** [December 22, 2023, 8:37pm UTC](https://discourse.haskell.org/t/serokell-s-work-on-ghc-dependent-types-part-2/8379/1 "2023-12-22T20:37:13Z")

</div>

> **[Dependent types in Haskell](https://serokell.io/blog/ghc-dependent-types-in-haskell-2)**
>
> At Serokell, we have a dedicated team working on GHC. The primary goal is to help add dependent types to Haskell, as outlined in GHC proposal #378, Design for Dependent Types..

---

<div class="post-metadata">

**Author:** ![mars0i](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.haskell.org/mars0i/32/869_2.png) [@mars0i](https://discourse.haskell.org/u/mars0i)\
**Post date:** [December 23, 2023, 5:35pm UTC](https://discourse.haskell.org/t/serokell-s-work-on-ghc-dependent-types-part-2/8379/2 "2023-12-23T17:35:21Z")

</div>

Thanks very much for the clear explanation, as well as, of course, the work on GHC itself.

---

<div class="post-metadata">

**Author:** ![blamario](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.haskell.org/blamario/32/860_2.png) [@blamario](https://discourse.haskell.org/u/blamario)\
**Post date:** [December 29, 2023, 1:45pm UTC](https://discourse.haskell.org/t/serokell-s-work-on-ghc-dependent-types-part-2/8379/3 "2023-12-29T13:45:24Z")

</div>

Am I reading correctly that `forall` is now a term-level keyword (i.e. can’t be used as an identifier) even without the new `RequiredTypeArguments` extension specified? Why? Was it too difficult to adjust the lexer to make `forall` keyword only in the presence of the language extension?

---

<div class="post-metadata">

**Author:** ![int-index](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.haskell.org/int-index/32/4156_2.png) [@int-index](https://discourse.haskell.org/u/int-index)\
**Post date:** [March 2, 2024, 3:58pm UTC](https://discourse.haskell.org/t/serokell-s-work-on-ghc-dependent-types-part-2/8379/4 "2024-03-02T15:58:47Z")

</div>

> Am I reading correctly that `forall` is now a term-level keyword (i.e. can’t be used as an identifier) even without the new `RequiredTypeArguments` extension specified?

That is correct.

> Was it too difficult to adjust the lexer to make `forall` keyword only in the presence of the language extension?

This precedent had been set earlier, when `forall` was made an unconditional keyword in types ([GHC Proposal #193](https://github.com/ghc-proposals/ghc-proposals/blob/master/proposals/0193-forall-keyword.rst)). You can’t name a type variable `forall` even if `ExplicitForAll` is disabled.

That is, `f :: a -> a` is valid but `f :: forall -> forall` is not. The reason is that it improves error messages if you forget to enable `ExplicitForAll`.

Previously, this was only affecting type variables (but not term variables). `RequiredTypeArguments` is a step towards unifying type and term syntax. If `forall` is a keyword, it’s got to be a keyword everywhere. So we have two viable options

1. Make `forall` a keyword everywhere (types and terms) regardless of enabled extensions
2. Make `forall` a keyword everywhere (types and terms) iff `ExplicitForAll` is enabled

The committee has made the judgement call to go with option (1).
