Compatibility Charter
BHC is a compiler for Haskell. Our default goal is source compatibility.
The Charter
- Baseline: Haskell 2010 compatibility mode (where supported by the current release)
- Pragmatic compatibility: selected GHC edition compatibility (GHC2021, GHC2024) for a documented subset of extensions
- BHC innovations: are opt-in via
BHC*extensions or profile selection
If you avoid BHC* extensions, you should be able to move your code between BHC and GHC with minimal change (subject to documented implementation gaps).
Important Statements
BHC does not define the Haskell standard. Haskell is a community language.
If an idea is generally useful, weβll try to upstream it to the broader Haskell ecosystem.
Compatibility Levels
| Level | Meaning |
|---|---|
| β | Compiles and matches semantics |
| π‘ | Compiles with minor changes |
| π | Compiles but performance/RTS differs |
| β | Not yet supported |
Supported Haskell Baseline
| Feature | Status | Notes |
|---|---|---|
| Haskell 2010 | β | Core language support |
| Haskell 98 | β | Via Haskell2010 mode |
GHC Edition Compatibility
BHC supports a documented subset of GHC editions. Not all GHC extensions are supported.
GHC2021 Subset
| Extension | Status |
|---|---|
| BangPatterns | β |
| BinaryLiterals | β |
| ConstrainedClassMethods | β |
| ConstraintKinds | β |
| DeriveDataTypeable | β |
| DeriveFoldable | β |
| DeriveFunctor | β |
| DeriveGeneric | β |
| DeriveLift | π‘ |
| DeriveTraversable | β |
| EmptyCase | β |
| EmptyDataDecls | β |
| EmptyDataDeriving | β |
| ExistentialQuantification | β |
| ExplicitForAll | β |
| FlexibleContexts | β |
| FlexibleInstances | β |
| GADTSyntax | β |
| GADTs | β |
| GeneralizedNewtypeDeriving | β |
| InstanceSigs | β |
| KindSignatures | β |
| LambdaCase | β |
| MultiParamTypeClasses | β |
| NamedFieldPuns | β |
| NumericUnderscores | β |
| PolyKinds | π‘ |
| RankNTypes | β |
| RecordWildCards | β |
| ScopedTypeVariables | β |
| StandaloneDeriving | β |
| TupleSections | β |
| TypeApplications | β |
| TypeOperators | β |
| TypeSynonymInstances | β |
GHC2024 Subset
Includes GHC2021, plus:
| Extension | Status |
|---|---|
| DataKinds | β |
| DerivingStrategies | β |
| DisambiguateRecordFields | β |
| ExplicitNamespaces | β |
| MonoLocalBinds | β |
| RoleAnnotations | π‘ |
Known Gaps
The following are not yet supported or have significant differences:
| Feature | Status | Notes |
|---|---|---|
| Template Haskell | β | Planned for future release |
| Foreign Function Interface (advanced) | π | Basic FFI works, some edge cases differ |
| GHC Plugins | β | Not planned for v1 |
| Backpack | β | Not planned |
| Unsafe operations | π | Supported but may differ in RTS behavior |
Conformance Testing
BHC maintains a conformance test suite tracking compatibility with Haskell 2010 and GHC editions.
Current status: Alpha β core language works, real-world compatibility testing underway.
Recent progress:
- Full Haskell 2010 layout rule implementation
- LANGUAGE pragma parsing
- Module system with qualified imports and export lists
- Type class and instance declarations
- Pattern guards, view patterns, as-patterns
- Type families and advanced type features
Not a Fork
BHC is not a fork of the Haskell language. Itβs a new compiler implementation that:
- Targets compatibility with existing Haskell standards and common GHC editions
- Innovates in runtime and targets (which can differ between implementations)
- Provides opt-in extensions with clear namespacing (
BHC.*)
If you never enable BHC* features, your code remains βordinary Haskellβ to the extent supported by the current BHC release.