Skip to content
  • Ben Orchard's avatar
    77171cd1
    Note mutability of array and address access primops · 77171cd1
    Ben Orchard authored and Marge Bot's avatar Marge Bot committed
    Without an understanding of immutable vs. mutable memory, the index
    primop family have a potentially non-intuitive type signature:
    
        indexOffAddr :: Addr# -> Int# -> a
        readOffAddr  :: Addr# -> Int# -> State# d -> (# State# d, a #)
    
    indexOffAddr# might seem like a free generality improvement, which it
    certainly is not!
    
    This change adds a brief note on mutability expectations for most
    index/read/write access primops.
    77171cd1
    Note mutability of array and address access primops
    Ben Orchard authored and Marge Bot's avatar Marge Bot committed
    Without an understanding of immutable vs. mutable memory, the index
    primop family have a potentially non-intuitive type signature:
    
        indexOffAddr :: Addr# -> Int# -> a
        readOffAddr  :: Addr# -> Int# -> State# d -> (# State# d, a #)
    
    indexOffAddr# might seem like a free generality improvement, which it
    certainly is not!
    
    This change adds a brief note on mutability expectations for most
    index/read/write access primops.
Loading