次のコードがあります。
test :: String -> Bool
test "g" = True
test "global" = True
test _ = False
それを GHCi (7.0.3) にロードすると、次のようになります。
Warning: Pattern match(es) are overlapped
In an equation for `test': test "g" = ...
これはバグですか、それとも何か不足していますか?
以下が成立します。
test "" == False
test "g" == True
test "gl" == False
test "global" == True
test "globalx" == False
アップデート:
を使用して{-# LANGUAGE OverloadedStrings #-}います。