我知道我可以通过fail
从拼接处调用来导致编译时错误,但是是否可以只生成警告?特别是我希望在使用-Werror
.
基本上我想要做的是:
todo :: Q Exp
todo = do
-- emit warning somehow
loc <- location
let message = ... -- generate message based on loc
[| error $(litE (stringL message)) |]
这个想法是undefined
在编码时使用它而不是使用它,但要确保它不会通过使用-Werror
.
myFunc x | isSimpleCase x = 42
| otherwise = $todo