Skip to content

GitLab

  • Menu
Projects Groups Snippets
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
  • Sign in / Register
  • GHC GHC
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
    • Locked Files
  • Issues 4,869
    • Issues 4,869
    • List
    • Boards
    • Service Desk
    • Milestones
    • Iterations
  • Merge requests 456
    • Merge requests 456
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
    • Test Cases
  • Deployments
    • Deployments
    • Releases
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Code review
    • Insights
    • Issue
    • Repository
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • Glasgow Haskell Compiler
  • GHCGHC
  • Issues
  • #20620
Closed
Open
Created Nov 04, 2021 by Andrew Martin@andrewthadDeveloper

Support ByteArray with UnliftedFFITypes

Motivation

I have a bunch of places in library where I pass a ByteArray to a C function through the FFI. For example:

foreign import ccall unsafe "rd_kafka_topic_partition_list_add"
  rdKafkaTopicPartitionListAdd ::
       Ptr TopicPartitionList                                                                  
    -> ByteArray#
    -> Partition
    -> IO (Ptr TopicPartition)

Every time I do this, I have to unwrap the ByteArray to expose the ByteArray# that I am trying to get at.

Proposal

When UnliftedFFITypes is enabled, allow ByteArray as an argument type in FFI calls. This is possible now that ByteArray has been moved to base.

To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information
Assignee
Assign to
Time tracking