withQListString :: [String] -> (CInt -> Ptr CWString -> IO a) -> IO a
withQListString xs f
  = withCWStrings xs [] $ \cxs ->
    withArray0 ptrNull cxs $ \carr ->
    f (toCInt len) carr
  where
    len = length xs
    withCWStrings [] cxs f
      = f (reverse cxs)
    withCWStrings (x:xs) cxs f
      = withCWString x $ \cx ->
        withCWStrings xs (cx:cxs) f
withQListString :: [String] -> (CInt -> Ptr CWString -> IO a) -> IO a
withQListString xs f
  = withCWStrings xs [] $ \cxs ->
    withArray0 ptrNull cxs $ \carr ->
    f (toCInt len) carr
  where
    len = length xs
    withCWStrings [] cxs f
      = f (reverse cxs)
    withCWStrings (x:xs) cxs f
      = withCWString x $ \cx ->
        withCWStrings xs (cx:cxs) f
withQListString xs f
  = withCWStrings xs [] $ \cxs ->
    withArray0 ptrNull cxs $ \carr ->
    f (toCInt len) carr
  where
    len = length xs
    withCWStrings [] cxs f
      = f (reverse cxs)
    withCWStrings (x:xs) cxs f
      = withCWString x $ \cx ->
        withCWStrings xs (cx:cxs) f