diff --git a/jukebox.cabal b/jukebox.cabal
--- a/jukebox.cabal
+++ b/jukebox.cabal
@@ -1,5 +1,5 @@
 Name: jukebox
-Version: 0.2.2
+Version: 0.2.3
 Cabal-version: >= 1.8
 Build-type: Simple
 Author: Nick Smallbone
@@ -17,6 +17,7 @@
   encoding types) and clausify problems (both typed and untyped).
 License: BSD3
 License-file: LICENSE
+extra-source-files: src/errors.h
 
 source-repository head
   type:     git
diff --git a/src/errors.h b/src/errors.h
new file mode 100644
--- /dev/null
+++ b/src/errors.h
@@ -0,0 +1,3 @@
+-- Inspired by Agda's undefined.h
+#define __ ERROR("internal error")
+#define ERROR(msg) (error (__FILE__ ++ ", line " ++ show (__LINE__ :: Int) ++ ": " ++ msg))
