
15 Jan
2024
15 Jan
'24
2:56 p.m.
On Mon, Jan 15, 2024 at 12:00:16PM +0100, Olaf Klinke wrote:
How can I teach GHC 9 that the pattern is indeed exhaustive?
Have you tried COMPLETE pragmas?
https://ghc.gitlab.haskell.org/ghc/doc/users_guide/exts/pragmas.html#complet...
Tom
Huh, of course that works. Thanks. It never occurred to me to even consider the existence of manual completeness annotation, since completeness checks work so reliably for ordinary constructors. But maybe my types weren't esoteric enough so far. Are there pattern-free cases where the GHC completeness checker is wrong? Of what computational class is the problem? Can I simulate a Turing machine by checking completeness in the presence of patterns? Olaf