How do you get the visual studio haskell extension to warn about incomplete-patterns ?
I don't see such a settings on VS code side. haskell-language-server has a pedantic plugin, disabled by default. Which I imagine can spot incomplete-patterns, just like stack build --pedantic can when building.
#!/usr/bin/env stack
-- stack --resolver lts-17.10 script
module SOQuestionIncomplete0 where
data Sum s t a = Inl (s a) | Inr (t a)
injs :: Sum s t a -> t a
injs (Inr ta) = ta -- incomplete, no warning
-- >>> injs (Inl [1 :: Int]) :: [Int]
-- /src/SOQuestionIncomplete0.hs:9:1-18: Non-exhaustive patterns in function injs
main :: IO ()
main = do
let a = injs (Inl [1 :: Int]) :: [Int]
putStrLn $ "Hello, World!" ++ show a