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 /utils/genprimopcode | |
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 'utils/genprimopcode')
-rw-r--r-- | utils/genprimopcode/Main.hs | 6 | ||||
-rw-r--r-- | utils/genprimopcode/Parser.y | 1 |
2 files changed, 3 insertions, 4 deletions
diff --git a/utils/genprimopcode/Main.hs b/utils/genprimopcode/Main.hs index a817c75a0d..36daa45a52 100644 --- a/utils/genprimopcode/Main.hs +++ b/utils/genprimopcode/Main.hs @@ -1,5 +1,7 @@ ------------------------------------------------------------------ -- A primop-table mangling program -- +-- +-- See Note [GHC.Prim] in primops.txt.pp for details. ------------------------------------------------------------------ module Main where @@ -293,8 +295,6 @@ gen_hs_source (Info defaults entries) = hdr (PrimOpSpec { name = n }) = wrapOp n ++ "," hdr (PrimVecOpSpec { name = n }) = wrapOp n ++ "," hdr (PseudoOpSpec { name = n }) = wrapOp n ++ "," - hdr (PrimTypeSpec { ty = TyApp (TyCon "->") _ }) = "" - -- GHC lacks the syntax to explicitly export "->" hdr (PrimTypeSpec { ty = TyApp (TyCon n) _ }) = wrapOp n ++ "," hdr (PrimTypeSpec {}) = error $ "Illegal type spec" hdr (PrimVecTypeSpec { ty = TyApp (VecTyCon n _) _ }) = wrapOp n ++ "," @@ -398,8 +398,6 @@ keep GHC's renamer and typechecker happy enough for what Haddock needs. Our main plan is to say foo :: <type> foo = foo -We have to silence GHC's complaints about unboxed-top-level declarations -with an ad-hoc fix in GHC.Tc.Gen.Bind: see Note [Compiling GHC.Prim] in GHC.Tc.Gen.Bind. That works for all the primitive functions except tagToEnum#. If we generate the binding diff --git a/utils/genprimopcode/Parser.y b/utils/genprimopcode/Parser.y index efcfee0889..f39af24c7c 100644 --- a/utils/genprimopcode/Parser.y +++ b/utils/genprimopcode/Parser.y @@ -163,6 +163,7 @@ paT : pTycon ppTs { TyApp $1 $2 } pUnboxedTupleTy :: { Ty } pUnboxedTupleTy : '(#' pCommaTypes '#)' { TyUTup $2 } + | '(#' '#)' { TyUTup [] } pCommaTypes :: { [Ty] } pCommaTypes : pType ',' pCommaTypes { $1 : $3 } |