[GHC] #9220: type roles for unboxed arrays

GHC ghc-devs at haskell.org
Wed Aug 27 21:20:03 UTC 2014


#9220: type roles for unboxed arrays
-------------------------------------+-------------------------------------
              Reporter:  rwbarton    |            Owner:  goldfire
                  Type:  bug         |           Status:  new
              Priority:  normal      |        Milestone:  7.10.1
             Component:  libraries   |          Version:  7.8.1
  (other)                            |         Keywords:
            Resolution:              |     Architecture:  Unknown/Multiple
      Operating System:              |       Difficulty:  Unknown
  Unknown/Multiple                   |       Blocked By:
       Type of failure:              |  Related Tickets:
  None/Unknown                       |
             Test Case:              |
              Blocking:              |
Differential Revisions:              |
-------------------------------------+-------------------------------------
Changes (by simonpj):

 * owner:   => goldfire


Comment:

 I'm OK with `Ptr` being different.  But if I have a `UArray (Int,Int)
 Age`, surely it's OK to cast it to `UArray (Int,Int) Int`, where
 {{{
 newtype Age = MkAge Int
 }}}
 After all, `Int` and `Age` are represented identically, and it might be
 useful to make such a bulk conversion.

 Yes there might be different instances somewhere, but that's true of
 ''all'' uses of `coerce`.  So I vote for the element parameter of these
 arrays being representational, rather than nominal.  Unless someone has
 other arguments to make.

 Richard (or Joachim), might you do this, in due course?

 Simon

--
Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/9220#comment:5>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler


More information about the ghc-tickets mailing list