Skip to content
  • Matthías Páll Gissurarson's avatar
    Implement the proposed -XQualifiedDo extension · 9ee58f8d
    Matthías Páll Gissurarson authored
    
    
    Co-authored-by: default avatarFacundo Domínguez <facundo.dominguez@tweag.io>
    
    QualifiedDo is implemented using the same placeholders for operation names in
    the AST that were devised for RebindableSyntax. Whenever the renamer checks
    which names to use for do syntax, it first checks if the do block is qualified
    (e.g. M.do { stmts }), in which case it searches for qualified names in
    the module M.
    
    This allows users to write
    
        {-# LANGUAGE QualifiedDo #-}
        import qualified SomeModule as M
    
        f x = M.do           -- desugars to:
          y <- M.return x    -- M.return x M.>>= \y ->
          M.return y         -- M.return y M.>>
          M.return y         -- M.return y
    
    See Note [QualifiedDo] and the users' guide for more details.
    
    Issue #18214
    
    Proposal:
    https://github.com/ghc-proposals/ghc-proposals/blob/master/proposals/0216-qualified-do.rst
    
    Since we change the constructors `ITdo` and `ITmdo` to carry the new module
    name, we need to bump the haddock submodule to account or the new shape of
    these constructors.
    9ee58f8d