External Publication
Visit Post

History of DH (Dependent Types in Haskell) contributions

Haskell Community [Unofficial] March 29, 2026
Source

Here’s a probably stupid idea I had for unification:

Use a type family that would redirect the term specific things. E.g.

data HsTerm s p =
    -- Variations of
HsVar/HsTyVar
HsOverLit, HsLit/HsTyLit
HsApp/HsAppTy
HsAppType/HsAppKindTy
OpApp/HsOpTy
HsPar/HsParTy
ExplicitTuple/HsExplicitTupleTy
ExplicitList/HsExplicitListTy
ExprWithTySig/HsKindSig
HsUntypedSplice/HsSpliceTy
HsHole/HsWildCardTy
HsForAll/HsForAllTy
HsQual/HsQualTy
HsFunArr/HsFunTy
    -- The redirect
    HsExprType !(XHsExprType s p) (ExprType s p)

data TermParam = Ty | Ex | Unknown -- like this to avoid name collisions in GHC, qualified imports would probably be used.

type family ExprType where
    ExprType Ty = OtherHsType
    ExprType Ex = OtherHsExpr
    ExprType Unknown= DataCannotHappen
type HsExpr = HsTerm Ex
type HsType = HsTerm Ty

Where OtherHsType and OtherHsExpr contain fields not mentioned above. I mainly propose this as with PatternSynonyms, I don’t think it’s a breaking change.

(Sorry for the formatting, I’ll change it when I’m at my computer)

Discussion in the ATmosphere

Loading comments...