, deinterleave
, toLSV
-
, wrapSocket
, closeSocket
, withCStrOrNull
+ , failOnError
)
where
import Bindings.EsounD
import Foreign.C.Types
import Foreign.Ptr
import Foreign.Storable
+import Prelude.Unicode
import System.IO
import System.Posix.IO
import System.Posix.Types
withCStrOrNull ∷ Maybe String → (CString → IO a) → IO a
withCStrOrNull Nothing f = f nullPtr
withCStrOrNull (Just s) f = withCString s f
+
+failOnError ∷ Monad m ⇒ String → CInt → m ()
+failOnError msg rv
+ | rv ≤ 0 = fail msg
+ | otherwise = return ()