Skip to content
Snippets Groups Projects
Forked from Glasgow Haskell Compiler / GHC
5508 commits behind the upstream repository.
  • Vladislav Zavialov's avatar
    8168b42a
    Whitespace-sensitive bang patterns (#1087, #17162) · 8168b42a
    Vladislav Zavialov authored
    This patch implements a part of GHC Proposal #229 that covers five
    operators:
    
    * the bang operator (!)
    * the tilde operator (~)
    * the at operator (@)
    * the dollar operator ($)
    * the double dollar operator ($$)
    
    Based on surrounding whitespace, these operators are disambiguated into
    bang patterns, lazy patterns, strictness annotations, type
    applications, splices, and typed splices.
    
    This patch doesn't cover the (-) operator or the -Woperator-whitespace
    warning, which are left as future work.
    8168b42a
    History
    Whitespace-sensitive bang patterns (#1087, #17162)
    Vladislav Zavialov authored
    This patch implements a part of GHC Proposal #229 that covers five
    operators:
    
    * the bang operator (!)
    * the tilde operator (~)
    * the at operator (@)
    * the dollar operator ($)
    * the double dollar operator ($$)
    
    Based on surrounding whitespace, these operators are disambiguated into
    bang patterns, lazy patterns, strictness annotations, type
    applications, splices, and typed splices.
    
    This patch doesn't cover the (-) operator or the -Woperator-whitespace
    warning, which are left as future work.
Code owners
Assign users and groups as approvers for specific file changes. Learn more.
proposal-229d.hs 160 B
{-# LANGUAGE BangPatterns #-}

module Proposal229d ((!)) where

(!) :: a -> b -> (a, b)
x ! y = (x,y)   -- parsed as an operator even with BangPatterns enabled