Skip to content
  • isovector's avatar
    Let the specialiser work on dicts under lambdas · 2d0cf625
    isovector authored and Marge Bot's avatar Marge Bot committed
    Following the discussion under #16473, this change allows the
    specializer to work on any dicts in a lambda, not just those that occur
    at the beginning.
    
    For example, if you use data types which contain dictionaries and
    higher-rank functions then once these are erased by the optimiser you
    end up with functions such as:
    
    ```
      go_s4K9
      Int#
      -> forall (m :: * -> *).
         Monad m =>
         (forall x. Union '[State (Sum Int)] x -> m x) -> m ()
    ```
    
    The dictionary argument is after the Int# value argument, this patch
    allows `go` to be specialised.
    2d0cf625