agrafix / superrecord

Haskell: Supercharged anonymous records
BSD 3-Clause "New" or "Revised" License
83 stars 16 forks source link

newtype Rec? #25

Closed axman6 closed 4 years ago

axman6 commented 4 years ago

Is there any reason why Rec isn't a newtype? Not sure if it would make much difference with the internal representation being a SmallArray#, but it doesn't look like it should hurt to make it a newtype.

neongreen commented 4 years ago

It can't be a newtype: A newtype cannot have an unlifted argument type. If we want Rec to be a normal lifted type, it has to be a data.

It can be an unlifted newtype with -XUnliftedNewtype, but that would make users' lives harder, I think.