Skip to content
  • Simon Peyton Jones's avatar
    Take account of GADTs when reporting patterm-match overlap · 5b494344
    Simon Peyton Jones authored
    When matching against a GADT, some of the constructors may be impossible.
    For example
    	data T a where
              T1 :: T Int
              T2 :: T Bool
              T3 :: T a
    
            f :: T Int -> Int
            f T1 = 3
            f T3 = 4
    
    Here, does not have any missing cases, despite omittting T2, because
    T2 :: T Bool.
    
    This patch teaches the overlap checker about GADTs, which happily
    turned out to be rather easy even though the overlap checker needs
    a serious rewrite.
    5b494344