Skip to content

Conversation

@ncaq
Copy link

@ncaq ncaq commented Oct 4, 2023

I had to deal with the useAsPtr in the new version of the text library, which seems to pass Ptr Word8 instead of Ptr UChar. It is probably safe to use castPtr for the same length, so I used it to solve the problem. I think it's safe to assume that the version that depends on the old text will just be the same with cast.

I had to deal with the `useAsPtr` in the new version of the text library, which seems to pass `Ptr Word8` instead of `Ptr UChar`.
It is probably safe to use `castPtr` for the same length, so I used it to solve the problem.
I think it's safe to assume that the version that depends on the old text will just be the same with cast.
@ncaq
Copy link
Author

ncaq commented Oct 4, 2023

In stackage it is required for compatibility from lts-21.

transliterator spec =
useAsPtr spec $ \ptr len -> do
q <- handleError $ openTrans ptr (fromIntegral len)
q <- handleError $ openTrans (castPtr ptr) (fromIntegral len)
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

have you actually verified the tests pass against this?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants