[Git][ghc/ghc][master] Fix @since annotations on WithDict and Coercible

Marge Bot (@marge-bot) gitlab at gitlab.haskell.org
Wed Nov 30 14:31:55 UTC 2022



Marge Bot pushed to branch master at Glasgow Haskell Compiler / GHC


Commits:
68c966cd by sheaf at 2022-11-30T09:31:25-05:00
Fix @since annotations on WithDict and Coercible

Fixes #22453

- - - - -


4 changed files:

- libraries/base/Data/Coerce.hs
- libraries/base/GHC/Exts.hs
- libraries/ghc-prim/GHC/Magic/Dict.hs
- libraries/ghc-prim/GHC/Types.hs


Changes:

=====================================
libraries/base/Data/Coerce.hs
=====================================
@@ -21,6 +21,7 @@
 
 module Data.Coerce
         ( -- * Safe coercions
+          -- @since 4.7.0.0
           coerce, Coercible
         ) where
 import GHC.Prim (coerce)


=====================================
libraries/base/GHC/Exts.hs
=====================================
@@ -122,6 +122,8 @@ module GHC.Exts
         unsafeCoerce#,
 
         -- ** Casting class dictionaries with single methods
+        --
+        --   @since 4.17.0.0
         WithDict(..),
 
         -- * The maximum tuple size


=====================================
libraries/ghc-prim/GHC/Magic/Dict.hs
=====================================
@@ -35,13 +35,23 @@ module GHC.Magic.Dict (
 
 import GHC.Types (RuntimeRep, TYPE)
 
--- | @'withDict' d f@ provides a way to call a type-class–overloaded function
--- @f@ by applying it to the supplied dictionary @d at .
+-- | The constraint @'WithDict' cls meth@ can be solved when evidence for
+-- the constraint @cls@ can be provided in the form of a dictionary of
+-- type @meth at . This requires @cls@ to be a class constraint whose single
+-- method has type @meth at .
 --
--- 'withDict' can only be used if the type class has a single method with no
--- superclasses. For more (important) details on how this works, see
+-- For more (important) details on how this works, see
 -- @Note [withDict]@ in "GHC.Tc.Instance.Class" in GHC.
+--
+--   @since 0.9.0
 class WithDict cls meth where
+  -- @'withDict' d f@ provides a way to call a type-class–overloaded function
+  -- @f@ by applying it to the supplied dictionary @d at .
+  --
+  -- 'withDict' can only be used if the type class has a single method with no
+  -- superclasses.
+  --
+  --   @since 0.9.0
   withDict :: forall {rr :: RuntimeRep} (r :: TYPE rr). meth -> (cls => r) -> r
 
 {- Note [withDict has an ambiguous type]


=====================================
libraries/ghc-prim/GHC/Types.hs
=====================================
@@ -350,7 +350,7 @@ infix 4 ~, ~~
 --      <http://research.microsoft.com/en-us/um/people/simonpj/papers/ext-f/coercible.pdf Safe Coercions>
 --      by Joachim Breitner, Richard A. Eisenberg, Simon Peyton Jones and Stephanie Weirich.
 --
---      @since 4.7.0.0
+-- @since 0.4.0
 class Coercible (a :: k) (b :: k)
   -- See also Note [The equality types story] in GHC.Builtin.Types.Prim
 



View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/68c966cd3c9d581bac4573807e433fe8d063445f

-- 
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/68c966cd3c9d581bac4573807e433fe8d063445f
You're receiving this email because of your account on gitlab.haskell.org.


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.haskell.org/pipermail/ghc-commits/attachments/20221130/9581ee0e/attachment-0001.html>


More information about the ghc-commits mailing list