hpaste

recent | annotate | new

{- # OPTIONS_GHC -Werror # -}

module Main where

foo :: Int -> Int -> String
foo x y =
    case (x, y) of
      (1, 1)    -> "all ones"
      (2, 3)    -> "two and three"
      (11, 12)  -> "umm... large numbers"
      otherwise -> "XXX no shadowing error here " ++ show otherwise

main = putStrLn $ foo 7 8

{- # OPTIONS_GHC -Werror # -}

module Main where

foo :: Int -> Int -> String
foo x y =
    case (x, y) of
      (1, 1)   -> "all ones"
      (2, 3)   -> "two and three"
      (11, 12) -> "umm... large numbers"
      _        -> "XXX no shadowing error here " ++ show (x, y)

main = putStrLn $ foo 7 8

{- # OPTIONS_GHC -Werror # -}

module Main where

foo :: Int -> Int -> String
foo x y =
    case (x, y) of
      (1, 1)   -> "all ones"
      (2, 3)   -> "two and three"
      (11, 12) -> "umm... large numbers"
      other    -> "XXX no shadowing error here " ++ show other

main = putStrLn $ foo 7 8

{-# OPTIONS_GHC -Wall -Werror #-} -- NOTE: the pragma was written incorrectly

module Main where

foo :: Int -> Int -> String
foo x y =
    case (x, y) of
      (1, 1)    -> "all ones"
      (2, 3)    -> "two and three"
      (11, 12)  -> "umm... large numbers"
--       otherwise -> "this does throw a shadowing error"
      _         -> "OK"

main :: IO ()
main = putStrLn $ foo 7 8