packages feed

haskell-gi-base 0.26.3 → 0.26.4

raw patch · 3 files changed

+15/−4 lines, 3 filesPVP: major bump suggested

API removals or changes: PVP suggests a major version bump

API changes (from Hackage documentation)

- Data.GI.Base.GVariant: instance Data.GI.Base.GVariant.IsGVariant Data.ByteString.Internal.ByteString
+ Data.GI.Base.GVariant: instance Data.GI.Base.GVariant.IsGVariant Data.ByteString.Internal.Type.ByteString
+ Data.GI.Base.ManagedPtr: withNewObject :: (HasCallStack, GObject o) => Ptr o -> (o -> IO b) -> IO b
- Data.GI.Base.GObject: new' :: (MonadIO m, GObject o) => (ManagedPtr o -> o) -> [m (GValueConstruct o)] -> m o
+ Data.GI.Base.GObject: new' :: (HasCallStack, MonadIO m, GObject o) => (ManagedPtr o -> o) -> [m (GValueConstruct o)] -> m o

Files

Data/GI/Base/GObject.hsc view
@@ -120,14 +120,14 @@  -- | Construct the given `GObject`, given a set of actions -- constructing desired `GValue`s to set at construction time.-new' :: (MonadIO m, GObject o) =>+new' :: (HasCallStack, MonadIO m, GObject o) =>         (ManagedPtr o -> o) -> [m (GValueConstruct o)] -> m o new' constructor actions = do   props <- sequence actions   doConstructGObject constructor props  -- | Construct the `GObject` given the list of `GValueConstruct`s.-doConstructGObject :: forall o m. (GObject o, MonadIO m)+doConstructGObject :: forall o m. (HasCallStack, GObject o, MonadIO m)                       => (ManagedPtr o -> o) -> [GValueConstruct o] -> m o doConstructGObject constructor props = liftIO $ do   let nprops = length props
Data/GI/Base/ManagedPtr.hs view
@@ -32,6 +32,7 @@      -- * Wrappers     , newObject+    , withNewObject     , wrapObject     , releaseObject     , unrefObject@@ -166,7 +167,7 @@  -- | Perform the IO action with a transient managed pointer. The -- managed pointer will be valid while calling the action, but will be--- disowned as soon as the action finished.+-- disowned as soon as the action finishes. withTransient :: (HasCallStack, ManagedPtrNewtype a)               => Ptr a -> (a -> IO b) -> IO b withTransient ptr action = do@@ -286,6 +287,16 @@   void $ g_object_ref_sink ptr   fPtr <- newManagedPtr' ptr_to_g_object_unref $ castPtr ptr   return $! constructor fPtr++-- | Perform the given IO action with a wrapped copy of the given ptr+-- to a GObject. Note that this increases the reference count of the+-- wrapped GObject, similarly to 'newObject'.+withNewObject :: (HasCallStack, GObject o)+                  => Ptr o -> (o -> IO b) -> IO b+withNewObject ptr action = do+  void $ g_object_ref_sink ptr+  managed <- newManagedPtr' ptr_to_g_object_unref $ castPtr ptr+  action (coerce managed)  -- | Same as 'newObject', but we steal ownership of the object. wrapObject :: forall a b. (HasCallStack, GObject a, GObject b) =>
haskell-gi-base.cabal view
@@ -1,5 +1,5 @@ name:                haskell-gi-base-version:             0.26.3+version:             0.26.4 synopsis:            Foundation for libraries generated by haskell-gi description:         Foundation for libraries generated by haskell-gi homepage:            https://github.com/haskell-gi/haskell-gi