Question Details

No question body available.

Tags

haskell functional-programming dependent-type singleton-type

Answers (1)

March 26, 2026 Score: 6 Rep: 52,894 Quality: Medium Completeness: 50%

You haven't really fleshed out your proposal for what this new GHC capability would look like. Are you imagining that GHC would, in the (very!) special case that an ADT or GADT has a single, zero-field constructor, substitute the pattern with that constructor?

If so, this would change the meaning of certain programs. Given:

data Foo = MkFoo

bar :: Foo -> Bool bar = True

the expression bar (last (repeat MkFoo)) evaluates to True. If GHC rewrote _ to MkFoo, it would evaluate to bottom.