Personal tools

Views

Catch

From HaskellWiki

Contents

1 Introduction

Do you sometimes encounter the dreaded "pattern match failure: head
[]" message? Do you have incomplete patterns which sometimes fail? Do
you have incomplete patterns which you know don't fail, but still get
compiler warnings about them? Would you like to statically ensure the
absence of all calls to error?

1.1 Location

For the last few years I've been working on a pattern-match checker
for Haskell, named Catch. I'm now happy to make a release:

1.3 Drawbacks:

Requires Yhc to be installed, which doesn't accept most Haskell extensions. This will be fixed once GHC.Core is available as a standalone library. The underlying tool is not limited to Haskell 98 in any way.

1.4 Related work:

Liquid Haskell - Annotate your functions with invariants that are checked at compile-time.

The total package does not search for incomplete pattern matches, but it does allow you to write compiler-checked exhaustive pattern matches. Blog post here.