# [ANN] Experimental Dependent Types in Haskell Fork

> Source: <https://discourse.haskell.org/t/ann-experimental-dependent-types-in-haskell-fork/15214#post_1>
> Published: 2026-11-28 03:20:03+00:00

**Key takeaway:** A GHC fork adds a -XDependentTypes extension with a dependent-base, a dependent-hackage overlay and a WASM playground, letting Haskell developers write dependently typed code and proofs today rather than waiting for upstream GHC.

Hey all!

Today I’m releasing my [fork of GHC](https://github.com/TharkunAB/ghc) that has `-XDependentTypes`:

I figured that if the slop cannon could solve the Riemann hypothesis, it could handle dependent Haskell. And it did!

To showcase what the fork could do, I had Gemini 4 Neon port [Programming Language Foundations in Agda](https://plfa.github.io/) to using dependent Haskell instead, and thanks to the excellent [GHC WASM backend](https://ghc.gitlab.haskell.org/ghc/doc/users_guide/wasm.html), you can play around with it in the browser directly. It even includes an Agda mode based on my valid hole-fits (and a hole-fit plugin), so you can get help with writing your proofs.

It also includes real world Haskell examples like Type-directed JSON encoding without type families, typed SQL schemas and joins, and Servant-style routing. You can now select your monad transformer stack at runtime!

Note: The goal here is not to upstream this (though the compiler team is welcome to it), but to build hype around dependent types in Haskell and to show that *Dependent Haskell is already possible* in terms of proposals and extensions. We just have to build it!

It includes a [dependent-base](https://plfh.tharkun.se/dependent-base/) and a playground for you to get started directly, available via a `head.hackage` like overlay called [dependent-hackage](https://github.com/TharkunAB/dependent-hackage) for any projects (e.g. `fourmolu` needs some AST changes). There’s even an [observational equivalence-based type-checker plugin](https://github.com/TharkunAB/dependent-obs-eq), which lets you “prove” that your non-dependently typed fast path matches the dependently typed implementation using QuickCheck (though only up to the generators and generated tests ofc).

**Validation**

The only consumers so far have been the PLFH book linked above (which turned up compiler bugs and showed where writing proofs was awkward), and my PiTA library (an extension of ECTAs with dependent types, used for valid hole-fits). There are also two plugins (observational equivalence and a typed-hole proof helper), that exercise some of the internals. I assume that the implementation is full of holes (typed holes even) and bugs, but those can all be fixed in good time. I’ve run a sweep of Stackage and most packages compile, barring some minor shims for GHC 10.1 compatibility. Some minor compiler issues are being fixed as well.

**Development notes**

The initial work was done mostly by GPT-6.2 Astra managing a team of GPT-6.2 Sol agents. After I ran out of usage and resets, Gemini took over with a team of Gemini 4 Carbon models. Both used their native harnesses, but with some additional skills based on Well-Typed blog posts, anti-slop and humanizer for writing, and an internal agentic-engineering plugin at DPella AB. Claude was also involved in writing the PiTA library, and surfaced multiple issues.

I based the prompts on [GHC proposal #378](https://github.com/ghc-proposals/ghc-proposals/blob/master/proposals/0378-dependent-type-design.rst), the [Serokell roadmap](https://ghc.serokell.io/dh), and Richard Eisenberg’s thesis, papers, and old GHC branch. The compiler, book, and PiTA work came to about 37.1 billion tokens in total, roughly 98% of them cache reads. At public API rates, that would have cost around $16k. I ran it all on subscriptions, with some help from three banked resets and [OpenAI’s generously timed billing bug](https://x.com/thsottiaux/status/2125784147889393806), as well as a Gemini Thanksgiving reset. So no need for a GoFundMe!

**Acknowledgements**

Some thanks are definitely in order:

Thanks to Richard Eisenberg for proposal #378, his thesis, and the old GHC branch that gave us a place to start. Thanks to Vladislav Zavialov, Andrei Borzenkov, and the rest of the Serokell team for the roadmap and years of work on GHC, and to everyone who wrote and reviewed the other proposals we drew on. Thanks to Philip Wadler, Wen Kokke, and Jeremy G. Siek for PLFA. Having a book full of proofs written for another language was a great way to find out where our compiler fell short.

Thanks to Cheng Shao, Norman Ramsey, and the other GHC Wasm contributors for making it possible to try this in a browser. Thanks to Jules (`@analytichegel` on twitter) for the observational equivalence idea behind the QuickCheck plugin, and to Mercury for [ghc-persistent-worker](https://github.com/MercuryTechnologies/ghc-persistent-worker/). With a few tweaks, it made those incremental GHC builds a lot faster! Andrea Bedini and IOG for [Foliage](https://github.com/ican-group/foliage), whose package metadata format we use in `dependent-hackage`.

And to you, thanks for reading! I hope you have a chance to look at it and play around with it, and report any issues you find on the repo. Hopefully this inspires some hype and we can get dependent types in GHC itself soon!
