Skip to content
  • Kirill Elagin's avatar
    pretty-printer: Properly parenthesise LastStmt · 1f9db3e7
    Kirill Elagin authored and Marge Bot's avatar Marge Bot committed
    After ApplicatveDo strips the last `return` during renaming, the pretty
    printer has to restore it. However, if the return was followed by `$`,
    the dollar was stripped too and not restored.
    
    For example, the last stamement in:
    
    ```
      foo = do
        x <- ...
        ...
        return $ f x
    ```
    
    would be printed as:
    
    ```
        return f x
    ```
    
    This commit preserved the dolar, so it becomes:
    
    ```
        return $ f x
    ```
    1f9db3e7