-- | Ensure that the given version of the namespace is loaded. If that
-- is not possible we error out.
girRequire :: Text -> Text -> IO Typelib
girRequire ns version =
    withTextCString ns $ \cns ->
    withTextCString version $ \cversion -> do
        typelib <- checkGError (g_irepository_require nullPtr cns cversion 0)
                               (error $ "Could not load typelib for "
                                          ++ show ns ++ " version "
                                          ++ show version)
        return (Typelib typelib)
girRequire :: Text -> Text -> IO Typelib
girRequire ns version =
    withTextCString ns $ \cns ->
    withTextCString version $ \cversion -> do
        typelib <- checkGError (g_irepository_require nullPtr cns cversion 0)
                               (error $ "Could not load typelib for "
                                          ++ show ns ++ " version "
                                          ++ show version)
        return (Typelib typelib)
girRequire ns version =
    withTextCString ns $ \cns ->
    withTextCString version $ \cversion -> do
        typelib <- checkGError (g_irepository_require nullPtr cns cversion 0)
                               (error $ "Could not load typelib for "
                                          ++ show ns ++ " version "
                                          ++ show version)
        return (Typelib typelib)