diff options
author | Krzysztof Gogolewski <krzysztof.gogolewski@tweag.io> | 2020-07-16 16:01:09 +0200 |
---|---|---|
committer | Marge Bot <ben+marge-bot@smart-cactus.org> | 2020-08-28 02:22:36 -0400 |
commit | c6f50cea42a9ffc947bf4243986663cc820b0ec8 (patch) | |
tree | 1afe6d0ac47040f9fe8f43cacb5a211e9a4c32b3 /libraries/ghc-prim | |
parent | bacccb73c9b080c3c01a5e55ecb0a00cd8a77e55 (diff) | |
download | haskell-c6f50cea42a9ffc947bf4243986663cc820b0ec8.tar.gz |
Add missing primop documentation (#18454)
- Add three pseudoops to primops.txt.pp, so that Haddock renders
the documentation
- Update comments
- Remove special case for "->" - it's no longer exported from GHC.Prim
- Remove reference to Note [Compiling GHC.Prim] - the ad-hoc fix is no
longer there after updates to levity polymorphism.
- Document GHC.Prim
- Remove the comment that lazy is levity-polymorphic.
As far as I can tell, it never was: in 80e399639,
only the unfolding was given an open type variable.
- Remove haddock hack in GHC.Magic - no longer neccessary after
adding realWorld# to primops.txt.pp.
Diffstat (limited to 'libraries/ghc-prim')
-rw-r--r-- | libraries/ghc-prim/GHC/Magic.hs | 17 |
1 files changed, 2 insertions, 15 deletions
diff --git a/libraries/ghc-prim/GHC/Magic.hs b/libraries/ghc-prim/GHC/Magic.hs index d1f2650a96..cd9474271d 100644 --- a/libraries/ghc-prim/GHC/Magic.hs +++ b/libraries/ghc-prim/GHC/Magic.hs @@ -1,8 +1,6 @@ -{-# LANGUAGE CPP #-} {-# LANGUAGE Trustworthy #-} {-# LANGUAGE NoImplicitPrelude #-} {-# LANGUAGE MagicHash #-} -{-# LANGUAGE UnboxedTuples #-} {-# LANGUAGE DataKinds #-} {-# LANGUAGE PolyKinds #-} {-# LANGUAGE ScopedTypeVariables #-} @@ -32,13 +30,8 @@ module GHC.Magic ( inline, noinline, lazy, oneShot, runRW# ) where -- Here import TYPE explicitly from GHC.Types and not from GHC.Prim. This is -- because TYPE is not exported by the source Haskell module generated by --- genprimops which Haddock will typecheck. --- Likewise, realWorld# is not generated by genprimops so we use CPP and only --- import/use it when not building haddock docs. -#if !defined(__HADDOCK_VERSION__) -import GHC.Prim (realWorld#) -#endif -import GHC.Prim (State#, RealWorld) +-- genprimops which Haddock will typecheck (#15935). +import GHC.Prim (State#, realWorld#, RealWorld) import GHC.Types (RuntimeRep, TYPE) -- | The call @inline f@ arranges that @f@ is inlined, regardless of @@ -83,8 +76,6 @@ noinline x = x -- -- If 'lazy' were not lazy, 'Control.Parallel.par' would look strict in -- @y@ which would defeat the whole purpose of 'Control.Parallel.par'. --- --- Like 'seq', the argument of 'lazy' can have an unboxed type. lazy :: a -> a lazy x = x -- Implementation note: its strictness and unfolding are over-ridden @@ -124,8 +115,4 @@ runRW# :: forall (r :: RuntimeRep) (o :: TYPE r). (State# RealWorld -> o) -> o -- See Note [runRW magic] in GHC.CoreToStg.Prep. {-# NOINLINE runRW# #-} -- runRW# is inlined manually in CorePrep -#if !defined(__HADDOCK_VERSION__) runRW# m = m realWorld# -#else -runRW# = runRW# -- The realWorld# is too much for haddock -#endif |