-
Notifications
You must be signed in to change notification settings - Fork 6
Open
Description
The PrimUnlifted ShortText instance uses fromShortByteStringUnsafe, which is considered Unsafe. I don't know just how wrong things can go if the bytestring isn't properly encoded, but based on the liberal "Unsafe!" warnings around FFI in text-short, I'd be worried.
Here's what I suggest: define an unlifted newtype around ByteArray# in an Unsafe module. Use that as the definition of Unlifted ShortText. Mark Data.Primitive.Unlifted.Class as Trustworthy. Users who just want to be able to make unlifted containers of ShortText won't have to change anything. Those who actually need to mess with the unlifted representation can import the unsafe module and do what they like.
Metadata
Metadata
Assignees
Labels
No labels