Skip to content
Snippets Groups Projects
  1. Feb 25, 2024
    • Ben Gamari's avatar
      Allow docstrings after exports · bbfb051c
      Ben Gamari authored
      Here we extend the parser and AST to preserve docstrings following
      export items. We then extend Haddock to parse `@since` annotations in
      such docstrings, allowing changes in export structure to be properly
      documented.
      bbfb051c
  2. Feb 24, 2024
  3. Feb 23, 2024
    • Ben Gamari's avatar
      Allow docstrings after exports · 5121a4ed
      Ben Gamari authored and Marge Bot's avatar Marge Bot committed
      Here we extend the parser and AST to preserve docstrings following
      export items. We then extend Haddock to parse `@since` annotations in
      such docstrings, allowing changes in export structure to be properly
      documented.
      
      Bumps haddock submodule.
      5121a4ed
  4. Feb 21, 2024
  5. Feb 20, 2024
  6. Feb 19, 2024
    • Cheng Shao's avatar
      testsuite: mark T23540 as fragile on i386 · a6142e0c
      Cheng Shao authored and Marge Bot's avatar Marge Bot committed
      See #24449 for details.
      a6142e0c
    • Cheng Shao's avatar
      hadrian: fix wasm backend post linker script permissions · 4696b966
      Cheng Shao authored and Marge Bot's avatar Marge Bot committed
      The post-link.mjs script was incorrectly copied and installed as a
      regular data file without executable permission, this commit fixes it.
      4696b966
    • Brandon Chinn's avatar
      Fix searching for errors in sphinx build · 35b0ad90
      Brandon Chinn authored and Marge Bot's avatar Marge Bot committed
      35b0ad90
    • John Ericson's avatar
      Fix reST in users guide · 17e309d2
      John Ericson authored and Marge Bot's avatar Marge Bot committed
      It appears that aef587f6 wasn't valid syntax.
      17e309d2
    • Jade's avatar
    • Andrei Borzenkov's avatar
      Parser, renamer, type checker for @a-binders (#17594) · 0dbd729e
      Andrei Borzenkov authored and Marge Bot's avatar Marge Bot committed
      GHC Proposal 448 introduces binders for invisible type arguments
      (@a-binders) in various contexts. This patch implements @-binders
      in lambda patterns and function equations:
      
        {-# LANGUAGE TypeAbstractions #-}
      
        id1 :: a -> a
        id1 @t x = x :: t      -- @t-binder on the LHS of a function equation
      
        higherRank :: (forall a. (Num a, Bounded a) => a -> a) -> (Int8, Int16)
        higherRank f = (f 42, f 42)
      
        ex :: (Int8, Int16)
        ex = higherRank (\ @a x -> maxBound @a - x )
                               -- @a-binder in a lambda pattern in an argument
                               -- to a higher-order function
      
      Syntax
      ------
      
      To represent those @-binders in the AST, the list of patterns in Match
      now uses ArgPat instead of Pat:
      
        data Match p body
           = Match {
               ...
      -        m_pats  :: [LPat p],
      +        m_pats  :: [LArgPat p],
               ...
         }
      
      + data ArgPat pass
      +   = VisPat (XVisPat pass) (LPat pass)
      +   | InvisPat (XInvisPat pass) (HsTyPat (NoGhcTc pass))
      +   | XArgPat !(XXArgPat pass)
      
      The VisPat constructor represents patterns for visible arguments,
      which include ordinary value-level arguments and required type arguments
      (neither is prefixed with a @), while InvisPat represents invisible type
      arguments (prefixed with a @).
      
      Parser
      ------
      
      In the grammar (Parser.y), the lambda and lambda-cases productions of
      aexp non-terminal were updated to accept argpats instead of apats:
      
        aexp : ...
      -        | '\\' apats '->' exp
      +        | '\\' argpats '->' exp
               ...
      -        | '\\' 'lcases' altslist(apats)
      +        | '\\' 'lcases' altslist(argpats)
               ...
      
      + argpat : apat
      +        | PREFIX_AT atype
      
      Function left-hand sides did not require any changes to the grammar, as
      they were already parsed with productions capable of parsing @-binders.
      Those binders were being rejected in post-processing (isFunLhs), and now
      we accept them.
      
      In Parser.PostProcess, patterns are constructed with the help of
      PatBuilder, which is used as an intermediate data structure when
      disambiguating between FunBind and PatBind. In this patch we define
      ArgPatBuilder to accompany PatBuilder. ArgPatBuilder is a short-lived
      data structure produced in isFunLhs and consumed in checkFunBind.
      
      Renamer
      -------
      
      Renaming of @-binders builds upon prior work on type patterns,
      implemented in 2afbddb0, which guarantees proper scoping and
      shadowing behavior of bound type variables.
      
      This patch merely defines rnLArgPatsAndThen to process a mix of visible
      and invisible patterns:
      
      + rnLArgPatsAndThen :: NameMaker -> [LArgPat GhcPs] -> CpsRn [LArgPat GhcRn]
      + rnLArgPatsAndThen mk = mapM (wrapSrcSpanCps rnArgPatAndThen) where
      +   rnArgPatAndThen (VisPat x p)    = ... rnLPatAndThen ...
      +   rnArgPatAndThen (InvisPat _ tp) = ... rnHsTyPat ...
      
      Common logic between rnArgPats and rnPats is factored out into the
      rn_pats_general helper.
      
      Type checker
      ------------
      
      Type-checking of @-binders builds upon prior work on lazy skolemisation,
      implemented in f5d3e03c.
      
      This patch extends tcMatchPats to handle @-binders. Now it takes and
      returns a list of LArgPat rather than LPat:
      
        tcMatchPats ::
                    ...
      -             -> [LPat GhcRn]
      +             -> [LArgPat GhcRn]
                    ...
      -             -> TcM ([LPat GhcTc], a)
      +             -> TcM ([LArgPat GhcTc], a)
      
      Invisible binders in the Match are matched up with invisible (Specified)
      foralls in the type. This is done with a new clause in the `loop` worker
      of tcMatchPats:
      
        loop :: [LArgPat GhcRn] -> [ExpPatType] -> TcM ([LArgPat GhcTc], a)
        loop (L l apat : pats) (ExpForAllPatTy (Bndr tv vis) : pat_tys)
          ...
          -- NEW CLAUSE:
          | InvisPat _ tp <- apat, isSpecifiedForAllTyFlag vis
          = ...
      
      In addition to that, tcMatchPats no longer discards type patterns. This
      is done by filterOutErasedPats in the desugarer instead.
      
      x86_64-linux-deb10-validate+debug_info
      Metric Increase:
          MultiLayerModulesTH_OneShot
      0dbd729e
    • Ben Gamari's avatar
      Drop dependence on `touch` · 7a0293cc
      Ben Gamari authored and Marge Bot's avatar Marge Bot committed
      This drops GHC's dependence on the `touch` program, instead implementing
      it within GHC. This eliminates an external dependency and means that we
      have one fewer program to keep track of in the `configure` script
      7a0293cc
  7. Feb 17, 2024
  8. Feb 16, 2024
  9. Feb 15, 2024
Loading