portnov / libvirt-hs

This package provides low-level (at this moment, at least) FFI bindings to libvirt library.
http://hackage.haskell.org/package/libvirt-hs
BSD 3-Clause "New" or "Revised" License
2 stars 1 forks source link

System/LibVirt/Foreign.chs:687:9: error: [GHC-83865] #5

Open abuibrahim opened 3 months ago

abuibrahim commented 3 months ago
Building library for libvirt-hs-0.2.2..
[1 of 4] Compiling System.LibVirt.Internal ( dist/build/System/LibVirt/Internal.hs, dist/build/System/LibVirt/Internal.o, dist/build/System/LibVirt/Internal.dyn_o )
[2 of 4] Compiling System.LibVirt.Errors ( dist/build/System/LibVirt/Errors.hs, dist/build/System/LibVirt/Errors.o, dist/build/System/LibVirt/Errors.dyn_o )
[3 of 4] Compiling System.LibVirt.Foreign ( dist/build/System/LibVirt/Foreign.hs, dist/build/System/LibVirt/Foreign.o, dist/build/System/LibVirt/Foreign.dyn_o )

System/LibVirt/Foreign.chs:687:9: error: [GHC-83865]
    • Couldn't match expected type: OpenFileFlags -> IO Fd
                  with actual type: IO Fd
    • The function ‘openFd’ is applied to four value arguments,
        but its type ‘FilePath -> OpenMode -> OpenFileFlags -> IO Fd’
        has only three
      In a stmt of a 'do' block:
        fd <- openFd path ReadOnly Nothing defaultFileFlags
      In the expression:
        do source <- mkSource $ \ st buf nbytes opaque -> do ...
           conn <- getStorageVolConnection vol
           st <- newStream conn []
           virStorageVolUpload
             (storageVolToPtr vol) (streamToPtr st) off len 0
             >>= exceptionOnMinusOne
           ....
    |
687 |   fd <- openFd path ReadOnly Nothing defaultFileFlags
    |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

System/LibVirt/Foreign.chs:687:30: error: [GHC-83865]
    • Couldn't match expected type ‘OpenFileFlags’
                  with actual type ‘Maybe a0’
    • In the third argument of ‘openFd’, namely ‘Nothing’
      In a stmt of a 'do' block:
        fd <- openFd path ReadOnly Nothing defaultFileFlags
      In the expression:
        do source <- mkSource $ \ st buf nbytes opaque -> do ...
           conn <- getStorageVolConnection vol
           st <- newStream conn []
           virStorageVolUpload
             (storageVolToPtr vol) (streamToPtr st) off len 0
             >>= exceptionOnMinusOne
           ....
    |
687 |   fd <- openFd path ReadOnly Nothing defaultFileFlags
    |                              ^^^^^^^
abuibrahim commented 3 months ago

fixed with https://github.com/portnov/libvirt-hs/pull/6