Which of the following PrimTyCons have a pointer-sized representations

Simon Peyton-Jones simonpj at microsoft.com
Fri Dec 7 12:36:27 CET 2012


You can use TyCon.tyConPrimRep, followed by primRepSizeW

Simon

| -----Original Message-----
| From: glasgow-haskell-users-bounces at haskell.org [mailto:glasgow-haskell-
| users-bounces at haskell.org] On Behalf Of Johan Tibell
| Sent: 06 December 2012 23:47
| To: glasgow-haskell-users
| Subject: Which of the following PrimTyCons have a pointer-sized
| representations
| 
| Hi,
| 
| As part of some work I'm doing I need to classify all PrimTyCons by the
| size of their representation as fields*. I need to classify them into
| two classes: pointer-sized (or smaller) and larger-than-pointer-sized.
| I've managed to figure out a bunch of them
| 
| myself:
| 
| Pointer-sized:
| 
| addrPrimTyCon
| arrayPrimTyCon
| byteArrayPrimTyCon  -- Represented as a pointer to heap object
| arrayArrayPrimTyCon  -- Represented as a pointer to heap object
| charPrimTyCon doublePrimTyCon  -- Only on 64-bit floatPrimTyCon
| intPrimTyCon int32PrimTyCon int64PrimTyCon  -- Only on 64-bit
| mutableArrayPrimTyCon  -- Represented as a pointer to heap object
| mutableByteArrayPrimTyCon  -- Represented as a pointer to heap object
| mutableArrayArrayPrimTyCon  -- Represented as a pointer to heap object
| wordPrimTyCon word32PrimTyCon word64PrimTyCon  -- Only on 64-bit
| 
| These ones I need help with:
| 
| bcoPrimTyCon
| weakPrimTyCon
| mVarPrimTyCon
| tVarPrimTyCon
| mutVarPrimTyCon
| realWorldTyCon
| stablePtrPrimTyCon
| stableNamePrimTyCon
| statePrimTyCon
| threadIdPrimTyCon
| anyTyCon
| eqPrimTyCon
| liftedTypeKindTyCon
| unliftedTypeKindTyCon
| openTypeKindTyCon
| constraintKindTyCon
| superKindTyCon
| anyKindTyCon
| 
| I would appreciate any help classifying the bottom half. I will use this
| to implement -funbox-strict-primitive-fields
| 
| * For example: while the StgArrWords heap object is a multi-byte object
| its representation as a field e.g. in data T = C ByteArray# is one
| pointer (to the StgArrWords heap object).
| 
| -- Johan
| 
| _______________________________________________
| Glasgow-haskell-users mailing list
| Glasgow-haskell-users at haskell.org
| http://www.haskell.org/mailman/listinfo/glasgow-haskell-users



More information about the Glasgow-haskell-users mailing list