In Data.Primitive.SmallArray, there's the function:
indexSmallArray## :: SmallArray a -> Int -> (#a#)
It returns its result in a one-element unboxed tuple.
My question is: what do we gain from returning the unboxed tuple? Why not return simply a?
I do get the usefulness of unboxed tuples of more than one element. As the Levity Polymorphism paper says:
Originally conceived to support returning multiple values from a function, an unboxed tuple is merely Haskell syntax for tying multiple values together. Unboxed tuples do not exist at runtime, at all [...] during compilation, the unboxed tuple is erased completely