Is there exist any way to check if my code contains: Non-exhaustive patterns in function
? Maybe some flag for compiler ?
Yes: -fwarn-incomplete-patterns
or simply -Wall
.
As @badcook hinted in the comment, if you want GHC to also warn non-exhausive patterns in lambdas you should add -fwarn-incomplete-uni-patterns
.