Skip to content
  • Vladislav Zavialov's avatar
    0f0c53a5
    T2T in Patterns (#23739) · 0f0c53a5
    Vladislav Zavialov authored and Marge Bot's avatar Marge Bot committed
    This patch implements the T2T (term-to-type) transformation in patterns.
    Patterns that are checked against a visible forall can now be written
    without the `type` keyword:
    
    	  \(type t) (x :: t) -> ...   -- old
    	  \t (x :: t) -> ...          -- new
    
    The `t` binder is parsed and renamed as a term pattern (Pat), but
    then undergoes a conversion to a type pattern (HsTyPat).
    See the new function pat_to_type_pat in compiler/GHC/Tc/Gen/Pat.hs
    0f0c53a5
    T2T in Patterns (#23739)
    Vladislav Zavialov authored and Marge Bot's avatar Marge Bot committed
    This patch implements the T2T (term-to-type) transformation in patterns.
    Patterns that are checked against a visible forall can now be written
    without the `type` keyword:
    
    	  \(type t) (x :: t) -> ...   -- old
    	  \t (x :: t) -> ...          -- new
    
    The `t` binder is parsed and renamed as a term pattern (Pat), but
    then undergoes a conversion to a type pattern (HsTyPat).
    See the new function pat_to_type_pat in compiler/GHC/Tc/Gen/Pat.hs
Loading