withQListDoubleResult :: (Ptr CDouble -> IO CInt) -> IO [Double]
withQListDoubleResult f
  = do
    clen <- f nullPtr
    let len = fromCInt clen
    if (len <= 0)
     then return []
     else allocaArray len $ \carr ->
          do f carr
             xs <- peekArray len carr
             return (map fromCDouble xs)
withQListDoubleResult :: (Ptr CDouble -> IO CInt) -> IO [Double]
withQListDoubleResult f
  = do
    clen <- f nullPtr
    let len = fromCInt clen
    if (len <= 0)
     then return []
     else allocaArray len $ \carr ->
          do f carr
             xs <- peekArray len carr
             return (map fromCDouble xs)
withQListDoubleResult f
  = do
    clen <- f nullPtr
    let len = fromCInt clen
    if (len <= 0)
     then return []
     else allocaArray len $ \carr ->
          do f carr
             xs <- peekArray len carr
             return (map fromCDouble xs)