[commit: ghc] master: primops: Add some notes regarding the meaning of the "type" field (6246407)

git at git.haskell.org git at git.haskell.org
Tue Sep 26 16:00:14 UTC 2017


Repository : ssh://git@git.haskell.org/ghc

On branch  : master
Link       : http://ghc.haskell.org/trac/ghc/changeset/62464071455ea0472903ef1d94833e5eefb8f74e/ghc

>---------------------------------------------------------------

commit 62464071455ea0472903ef1d94833e5eefb8f74e
Author: Ben Gamari <ben at smart-cactus.org>
Date:   Tue Sep 26 09:33:53 2017 -0400

    primops: Add some notes regarding the meaning of the "type" field
    
    The overloading of "monadic" definitely deserved some explanation.
    
    [skip ci]


>---------------------------------------------------------------

62464071455ea0472903ef1d94833e5eefb8f74e
 compiler/prelude/primops.txt.pp | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/compiler/prelude/primops.txt.pp b/compiler/prelude/primops.txt.pp
index f2c02ec..afe5849 100644
--- a/compiler/prelude/primops.txt.pp
+++ b/compiler/prelude/primops.txt.pp
@@ -38,6 +38,14 @@
 -- processors of this file to easily get hold of simple info
 -- (eg, out_of_line), whilst avoiding parsing complex expressions
 -- needed for strictness info.
+--
+-- type refers to the general category of the primop. Valid settings include,
+--
+--  * Compare:   A comparison operation of the shape a -> a -> Int#
+--  * Monadic:   A unary operation of shape a -> a
+--  * Dyadic:    A binary operation of shape a -> a -> a
+--  * GenPrimOp: Any other sort of primop
+--
 
 -- The vector attribute is rather special. It takes a list of 3-tuples, each of
 -- which is of the form <ELEM_TYPE,SCALAR_TYPE,LENGTH>. ELEM_TYPE is the type of



More information about the ghc-commits mailing list