Skip to content

add Data.Text.Foreign.peekCString? #239

Description

@chessai

we already have peekCStringLen:

peekCStringLen :: CStringLen -> IO Text
peekCStringLen cs = do
  bs <- unsafePackCStringLen cs
  return $! decodeUtf8 bs

would it make sense to have peekCString?

peekCString :: CString -> IO Text
peekCString cs = do
  bs <- unsafePackCString cs
  return $! decodeUtf8 bs

It just calls a different function from Data.ByteString.Unsafe. It seems like Data.Text.Foreign would be a natural home for this given that peekCStringLen is already there.

Activity

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

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions