I know that I can cause a compile-time error by causing fail from splicing, but is it possible to generate a warning? In particular, I would like this message to be turned into a compilation error with -Werror .
Essentially, I'm trying to do the following:
todo :: Q Exp todo = do -- emit warning somehow loc <- location let message = ... -- generate message based on loc [| error $(litE (stringL message)) |]
The idea is to use this instead of undefined during coding, but make sure that it does not sneak into production code by compiling with -Werror .
myFunc x | isSimpleCase x = 42 | otherwise = $todo
source share