sml抑制有意非穷举模式匹配的警告

sml抑制有意非穷举模式匹配的警告,sml,Sml,假设我有一个数据类型,如: datatype location = Safe of string | Dangerous of string * int; 在这个假设的例子中,我想写一个函数,它只会被传递一个安全str,而不会被传递一个危险(str,num): 有没有办法抑制这些警告?告诉SML我知道这是非消耗性的 stdIn:1.6-1.29 Warning: match nonexhaustive Safe s => ... 不直接。您可以通过一个失败案例来“告

假设我有一个数据类型,如:

datatype location = Safe of string | Dangerous of string * int;
在这个假设的例子中,我想写一个函数,它只会被传递一个
安全str
,而不会被传递一个
危险(str,num)

有没有办法抑制这些警告?告诉SML我知道这是非消耗性的

stdIn:1.6-1.29 Warning: match nonexhaustive
          Safe s => ...
不直接。您可以通过一个失败案例来“告诉”SML:

fun sendKinds (Safe address) = ...
  | sendKinds _ = raise Fail "sendKinds"
fun sendKinds (Safe address) = ...
  | sendKinds _ = raise Fail "sendKinds"