threepenny-gui 0.9.4.1 → 0.9.4.2
raw patch · 3 files changed
+158/−113 lines, 3 filesdep ~basedep ~containersdep ~data-default
Dependency ranges changed: base, containers, data-default, hashable, template-haskell
Files
- CHANGELOG.md +4/−0
- src/Foreign/JavaScript/Types.hs +59/−23
- threepenny-gui.cabal +95/−90
CHANGELOG.md view
@@ -1,5 +1,9 @@ ## Changelog for the `threepenny-gui` package +**0.9.4.2** – Maintenance and snapshot release++* Bump dependencies for compatibility with GHC-9.12.+ **0.9.4.1** – Maintenance and snapshot release * Bump dependencies for compatibility with GHC-9.8.
src/Foreign/JavaScript/Types.hs view
@@ -1,20 +1,50 @@ {-# LANGUAGE OverloadedStrings, DeriveDataTypeable #-} module Foreign.JavaScript.Types where +import Control.Concurrent.STM+ ( STM+ , TMVar+ , TQueue+ , TVar+ )+import Control.DeepSeq+ ( NFData (..)+ , force+ )+import Data.Aeson+ ( toJSON+ , (.=)+ , (.:)+ )+import Data.ByteString.Char8+ ( ByteString+ )+import Data.Map+ ( Map+ )+import Data.String+ ( fromString+ )+import Data.Text+ ( Text+ )+import Data.Typeable+ ( Typeable+ )+import Snap.Core+ ( Cookie(..)+ )+import System.IO+ ( stderr+ )++import qualified Control.Concurrent.STM as STM import qualified Control.Exception as E-import Control.Concurrent.STM as STM-import Control.Concurrent.MVar-import Control.DeepSeq-import Data.Aeson as JSON-import Data.ByteString.Char8 (ByteString)-import qualified Data.ByteString.Char8 as BS (hPutStrLn)-import Data.Map as Map-import Data.String-import Data.Text-import Data.Typeable-import Snap.Core (Cookie(..))-import System.IO (stderr)+import qualified Data.Aeson as JSON+import qualified Data.ByteString.Char8 as BS (hPutStrLn)+import qualified Data.Map as Map +import Control.Concurrent.MVar import Foreign.RemotePtr {-----------------------------------------------------------------------------@@ -196,8 +226,8 @@ | Quit deriving (Eq, Show) -instance FromJSON ClientMsg where- parseJSON (Object msg) = do+instance JSON.FromJSON ClientMsg where+ parseJSON (JSON.Object msg) = do tag <- msg .: "tag" case (tag :: Text) of "Event" -> Event <$> (msg .: "name") <*> (msg .: "arguments")@@ -209,8 +239,10 @@ readClient c = do msg <- readComm c case JSON.fromJSON msg of- Error s -> error $ "Foreign.JavaScript: Error parsing client message " ++ show s- Success x -> return x+ JSON.Error s ->+ error $ "Foreign.JavaScript: Error parsing client message " ++ show s+ JSON.Success x+ -> pure x -- | Messages sent by the Haskell server. data ServerMsg@@ -226,11 +258,15 @@ rnf (Debug x) = rnf x rnf (Timestamp ) = () -instance ToJSON ServerMsg where- toJSON (Debug x) = object [ "tag" .= t "Debug" , "contents" .= toJSON x]- toJSON (Timestamp ) = object [ "tag" .= t "Timestamp" ]- toJSON (RunEval x) = object [ "tag" .= t "RunEval" , "contents" .= toJSON x]- toJSON (CallEval x) = object [ "tag" .= t "CallEval", "contents" .= toJSON x]+instance JSON.ToJSON ServerMsg where+ toJSON (Debug x) =+ JSON.object [ "tag" .= t "Debug", "contents" .= toJSON x]+ toJSON Timestamp =+ JSON.object [ "tag" .= t "Timestamp" ]+ toJSON (RunEval x) =+ JSON.object [ "tag" .= t "RunEval", "contents" .= toJSON x]+ toJSON (CallEval x) =+ JSON.object [ "tag" .= t "CallEval", "contents" .= toJSON x] t :: String -> Text t s = fromString s@@ -335,8 +371,8 @@ newPartialWindow :: IO Window newPartialWindow = do ptr <- newRemotePtr "" () =<< newVendor- b1 <- newTMVarIO id- b2 <- newTVarIO NoBuffering+ b1 <- STM.newTMVarIO id+ b2 <- STM.newTVarIO NoBuffering let nop = const $ return () Window undefined [] nop undefined b1 b2 (return ()) nop nop ptr <$> newVendor <*> newVendor
threepenny-gui.cabal view
@@ -1,7 +1,7 @@-Name: threepenny-gui-Version: 0.9.4.1-Synopsis: GUI framework that uses the web browser as a display.-Description:+name: threepenny-gui+version: 0.9.4.2+synopsis: GUI framework that uses the web browser as a display.+description: Threepenny-GUI is a GUI framework that uses the web browser as a display. . It's very easy to install because everyone has a web browser installed.@@ -19,40 +19,45 @@ . @cabal install threepenny-gui -fbuildExamples@ -License: BSD3-License-file: LICENSE-Author: Heinrich Apfelmus-Maintainer: Heinrich Apfelmus <apfelmus at quantentunnel dot de>-Homepage: http://wiki.haskell.org/Threepenny-gui+license: BSD3+license-file: LICENSE+author: Heinrich Apfelmus+maintainer: Heinrich Apfelmus <apfelmus at quantentunnel dot de>+homepage: http://wiki.haskell.org/Threepenny-gui bug-reports: https://github.com/HeinrichApfelmus/threepenny-gui/issues-Category: Web, GUI-Build-type: Simple-Cabal-version: >=1.10-Tested-With: GHC == 8.0.2- ,GHC == 8.2.2- ,GHC == 8.4.4- ,GHC == 8.6.5- ,GHC == 8.8.4- ,GHC == 8.10.7- ,GHC == 9.2.8- ,GHC == 9.4.7- ,GHC == 9.6.3- ,GHC == 9.8.1+category: Web, GUI+build-type: Simple+cabal-version: >=1.10+tested-with:+ GHC == 8.0.2+ , GHC == 8.2.2+ , GHC == 8.4.4+ , GHC == 8.6.5+ , GHC == 8.8.4+ , GHC == 8.10.7+ , GHC == 9.2.8+ , GHC == 9.4.7+ , GHC == 9.6.6+ , GHC == 9.8.4+ , GHC == 9.10.1+ , GHC == 9.12.1 -Extra-Source-Files: CHANGELOG.md- ,README.md- ,samples/README.md- ,js/*.html- ,js/*.css- ,js/*.js- ,js/lib/*.js+extra-source-Files:+ CHANGELOG.md+ , README.md+ , samples/README.md+ , js/*.html+ , js/*.css+ , js/*.js+ , js/lib/*.js -Data-dir: .-Data-files: samples/static/css/*.css- ,samples/static/css/*.png- ,samples/static/*.html- ,samples/static/*.png- ,samples/static/*.wav+data-dir: .+data-files:+ samples/static/css/*.css+ , samples/static/css/*.png+ , samples/static/*.html+ , samples/static/*.png+ , samples/static/*.wav flag buildExamples@@ -69,72 +74,72 @@ default: False manual: True -Source-repository head+source-repository head type: git location: git://github.com/HeinrichApfelmus/threepenny-gui.git --Library+library hs-source-dirs: src exposed-modules:- Foreign.JavaScript- ,Foreign.RemotePtr- ,Graphics.UI.Threepenny- ,Graphics.UI.Threepenny.Attributes- ,Graphics.UI.Threepenny.Canvas- ,Graphics.UI.Threepenny.Core- ,Graphics.UI.Threepenny.DragNDrop- ,Graphics.UI.Threepenny.Elements- ,Graphics.UI.Threepenny.Events- ,Graphics.UI.Threepenny.JQuery- ,Graphics.UI.Threepenny.SVG- ,Graphics.UI.Threepenny.SVG.Attributes- ,Graphics.UI.Threepenny.SVG.Elements- ,Graphics.UI.Threepenny.Timer- ,Graphics.UI.Threepenny.Widgets- ,Reactive.Threepenny+ Foreign.JavaScript+ Foreign.RemotePtr+ Graphics.UI.Threepenny+ Graphics.UI.Threepenny.Attributes+ Graphics.UI.Threepenny.Canvas+ Graphics.UI.Threepenny.Core+ Graphics.UI.Threepenny.DragNDrop+ Graphics.UI.Threepenny.Elements+ Graphics.UI.Threepenny.Events+ Graphics.UI.Threepenny.JQuery+ Graphics.UI.Threepenny.SVG+ Graphics.UI.Threepenny.SVG.Attributes+ Graphics.UI.Threepenny.SVG.Elements+ Graphics.UI.Threepenny.Timer+ Graphics.UI.Threepenny.Widgets+ Reactive.Threepenny other-modules:- Foreign.JavaScript.CallBuffer- ,Foreign.JavaScript.EventLoop- ,Foreign.JavaScript.Include- ,Foreign.JavaScript.Marshal- ,Foreign.JavaScript.Resources- ,Foreign.JavaScript.Server- ,Foreign.JavaScript.Types- ,Graphics.UI.Threepenny.Internal- ,Reactive.Threepenny.Memo- ,Reactive.Threepenny.Monads- ,Reactive.Threepenny.PulseLatch- ,Reactive.Threepenny.Types- ,Paths_threepenny_gui+ Foreign.JavaScript.CallBuffer+ Foreign.JavaScript.EventLoop+ Foreign.JavaScript.Include+ Foreign.JavaScript.Marshal+ Foreign.JavaScript.Resources+ Foreign.JavaScript.Server+ Foreign.JavaScript.Types+ Graphics.UI.Threepenny.Internal+ Reactive.Threepenny.Memo+ Reactive.Threepenny.Monads+ Reactive.Threepenny.PulseLatch+ Reactive.Threepenny.Types+ Paths_threepenny_gui other-extensions: CPP cpp-options: -DCABAL if flag(rebug) cpp-options: -DREBUG ghc-options: -O2- build-depends: base >= 4.8 && < 4.20- ,aeson (>= 0.7 && < 0.10) || == 0.11.* || (>= 1.0 && < 2.3)- ,async >= 2.0 && < 2.3- ,bytestring >= 0.9.2 && < 0.13- ,containers >= 0.4.2 && < 0.8- ,data-default >= 0.5.0 && < 0.8- ,deepseq >= 1.3.0 && < 1.6- ,exceptions >= 0.6 && < 0.11- ,filepath >= 1.3.0 && < 1.6.0- ,file-embed >= 0.0.10 && < 0.1- ,hashable >= 1.2.0 && < 1.5- ,safe == 0.3.*- ,snap-server >= 0.9.0 && < 1.2- ,snap-core >= 0.9.0 && < 1.1- ,stm >= 2.2 && < 2.6- ,template-haskell >= 2.7.0 && < 2.22- ,text >= 0.11 && < 2.2- ,transformers >= 0.3.0 && < 0.7- ,unordered-containers == 0.2.*- ,websockets (>= 0.8 && < 0.12.5) || (> 0.12.5.0 && < 0.14)- ,websockets-snap >= 0.8 && < 0.11- ,vault == 0.3.*- ,vector >= 0.10 && < 0.14+ build-depends:+ base >= 4.8 && < 4.22+ , aeson (>= 0.7 && < 0.10) || == 0.11.* || (>= 1.0 && < 2.3)+ , async >= 2.0 && < 2.3+ , bytestring >= 0.9.2 && < 0.13+ , containers >= 0.4.2 && < 0.8+ , data-default >= 0.5.0 && < 0.8+ , deepseq >= 1.3.0 && < 1.6+ , exceptions >= 0.6 && < 0.11+ , filepath >= 1.3.0 && < 1.6.0+ , file-embed >= 0.0.10 && < 0.1+ , hashable >= 1.2.0 && < 1.6+ , safe == 0.3.*+ , snap-server >= 0.9.0 && < 1.2+ , snap-core >= 0.9.0 && < 1.1+ , stm >= 2.2 && < 2.6+ , template-haskell >= 2.7.0 && < 2.24+ , text >= 0.11 && < 2.2+ , transformers >= 0.3.0 && < 0.7+ , unordered-containers == 0.2.*+ , websockets (>= 0.8 && < 0.12.5) || (> 0.12.5.0 && < 0.14)+ , websockets-snap >= 0.8 && < 0.11+ , vault >= 0.3 && < 0.4+ , vector >= 0.10 && < 0.14 if impl(ghc >= 8.0) ghc-options: -Wcompat -Wnoncanonical-monad-instances default-language: Haskell2010