You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
The text was updated successfully, but these errors were encountered:
I've got this defined in one of my projects:
In GHC 9.4, we can apply
Array#
to boxed unlifted types (previously, there was a nastyArrayArray#
type that was awful to use), so with this type, we can finally write things like:I don't technically need for
ShortText#
to live intext-short
, but I thought it might be a reasonable place for it to live. It requiresUnliftedNewtypes
, which is only available since GHC 8.10.The text was updated successfully, but these errors were encountered: