Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
有没有办法检查我的代码是否包含:Non-exhaustive patterns in function?也许编译器的一些标志?
Non-exhaustive patterns in function
是的:-fwarn-incomplete-patterns或者简单地说-Wall。
-fwarn-incomplete-patterns
-Wall
正如@badcook 在评论中暗示的那样,如果您希望 GHC 也警告 lambdas 中的非详尽模式,您应该添加-fwarn-incomplete-uni-patterns.
-fwarn-incomplete-uni-patterns