gi-gtk-declarative-app-simple 0.4.0 → 0.4.1
raw patch · 2 files changed
+20/−3 lines, 2 filesdep ~gi-gtk-declarativePVP ok
version bump matches the API change (PVP)
Dependency ranges changed: gi-gtk-declarative
API changes (from Hackage documentation)
Files
gi-gtk-declarative-app-simple.cabal view
@@ -1,5 +1,5 @@ name: gi-gtk-declarative-app-simple-version: 0.4.0+version: 0.4.1 synopsis: Declarative GTK+ programming in Haskell in the style of Pux. description: Experimental application architecture in the style of PureScript Pux, built on top of gi-gtk-declarative.@@ -26,7 +26,6 @@ , gi-gobject >= 2 && <3 , gi-glib , gi-gtk >= 3 && <4- , gi-gtk-declarative >= 0.1.0 && <2 , gi-gdk , haskell-gi >= 0.21 && <0.22 , haskell-gi-base >= 0.21 && <0.22@@ -34,6 +33,7 @@ , pipes >= 4 && <5 , pipes-concurrency >= 2 && <3 , text+ , gi-gtk-declarative >= 0.4 && <0.5 hs-source-dirs: src default-language: Haskell2010 ghc-options: -Wall
src/GI/Gtk/Declarative/App/Simple.hs view
@@ -26,6 +26,8 @@ import GI.Gtk.Declarative.State import Pipes import Pipes.Concurrent+import System.Exit+import System.IO -- | Describes an state reducer application. data App window state event =@@ -72,6 +74,7 @@ => App window state event -- ^ Application to run -> IO state run app = do+ assertRuntimeSupportsBoundThreads void $ Gtk.init Nothing Async.withAsync (runLoop app <* Gtk.mainQuit) $ \lastState -> do Gtk.main@@ -92,7 +95,10 @@ -- Gtk.mainQuit -- Gtk.main -- @-runLoop :: (Typeable event, Gtk.IsWindow window, Gtk.IsBin window) => App window state event -> IO state+runLoop+ :: (Typeable event, Gtk.IsWindow window, Gtk.IsBin window)+ => App window state event+ -> IO state runLoop App {..} = do let firstMarkup = view initialState events <- newChan@@ -138,6 +144,17 @@ -- Finally, we loop. loop newState newMarkup events sub newModel Exit -> return oldModel++-- | Assert that the program was linked using the @-threaded@ flag, to+-- enable the threaded runtime required by this module.+assertRuntimeSupportsBoundThreads :: IO ()+assertRuntimeSupportsBoundThreads =+ unless rtsSupportsBoundThreads $ do+ hPutStrLn stderr "GI.Gtk.Declarative.App.Simple requires the program to \+ \be linked using the threaded runtime of GHC (-threaded \+ \flag)."+ exitFailure+ publishEvent :: Chan event -> event -> IO () publishEvent mvar = void . writeChan mvar