c2hs: string list param - Haskell

Welcome to the Functional Programming Zulip Chat Archive. You can join the chat here.

Torsten Schmits

How do I define a fun that has a parameter of type const char **? [String] doesn't do it, with* String neither.

Torsten Schmits

(I just got into cffi yesterday, and the docs are very sparse and cryptic, so I'm struggling)

Torsten Schmits

the C api doc says "null terminated list of strings", so I had kinda expected [String] to just work

Torsten Schmits

so Ptr String compiles, but it seems to involve a lot of ceremony at callsites, is there anything to alleviate that?

Torsten Schmits

alright, I have

s1 <- newCString "foo"
withArray [s1] apiFunc

guess that should be fine.