2011-04-25 53 views

回答

9

您可以要求警告,包括不完整的圖案,以-Wall

{-# OPTIONS_GHC -Wall #-} 

module A where 

f :: Int -> Int 
f 0 = 0 

產量:

A.hs:6:1: 
Warning: Pattern match(es) are non-exhaustive 
    In an equation for `f': 
     Patterns not matched: GHC.Types.I# #x with #x `notElem` [0#] 

或者更具體地說,用-fwarn-incomplete-patterns地質儲量-Wall

沒有什麼可以在每個表達式基礎上工作:您當前僅限於每個模塊的基礎。

相關問題