-
Notifications
You must be signed in to change notification settings - Fork 19
Open
Description
I've got this defined in one of my projects:
newtype ShortText# :: TYPE ('BoxedRep 'Unlifted) where
ShortText# :: ByteArray# -> ShortText#
lift :: ShortText# -> ShortText
lift (ShortText# x) = TS.fromShortByteStringUnsafe (SBS x)
unlift :: ShortText -> ShortText#
unlift t = case TS.toShortByteString t of
SBS x -> ShortText# x
In GHC 9.4, we can apply Array# to boxed unlifted types (previously, there was a nasty ArrayArray# type that was awful to use), so with this type, we can finally write things like:
Array# ShortText#
I don't technically need for ShortText# to live in text-short, but I thought it might be a reasonable place for it to live. It requires UnliftedNewtypes, which is only available since GHC 8.10.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels