Skip to content
  • Simon Peyton Jones's avatar
    Add -fmono-pat-binds, and make it the default · 10ffe4f7
    Simon Peyton Jones authored
    In Haskell 98, pattern bindings are generalised.  Thus in
    	(f,g) = (\x->x, \y->y)
    both f and g will get polymorphic types.  I have become convinced
    that generalisation for pattern-bound variables is just a bridge
    toof far. It is (I claim) almost never needed, and it adds significant
    complication.  (All the more so if we add bang patterns.)
    
    So the flag -fmono-pat-binds switches off generalisation for pattern
    bindings.  (A single variable is treated as a degnerate funtction
    binding.)  
    
    Furthremore, as an experiment, I'm making it the default.  I want
    to see how many progarms fail with monomorphic pattern bindings.
    
    You can recover the standard behaviour with -fno-mono-pa-binds.
    10ffe4f7