[Haskell-cafe] Wincomplete-uni-patterns and bidirectional patterns

Olaf Klinke olf at aatal-apotheke.de
Mon Jan 15 19:56:33 UTC 2024


> 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#complete-pragmas
> 
> 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



More information about the Haskell-Cafe mailing list