This GADT has a phantom type that gets refined (GHC-sense) by its constructor(s). That phantom type has a refinement (LH-sense) in the GADT-signature of its constructor. When we pattern match on the GADT constructor, GHC learns its type, but LH doesn't learn the refinement-type.
{-@
data Foo result where A :: Foo {i:Int | i == 0 } @-}
data Foo result where A :: Foo Int
foo :: Foo result -> result
foo A = 123
This GADT has a phantom type that gets refined (GHC-sense) by its constructor(s). That phantom type has a refinement (LH-sense) in the GADT-signature of its constructor. When we pattern match on the GADT constructor, GHC learns its type, but LH doesn't learn the refinement-type.
http://goto.ucsd.edu:8090/index.html#?demo=permalink%2F1667027035_14060.hs
Foo result
is constructed byA
.