From 2b9ceaead3f3cd80e973cccecb9a3eebc51154f7 Mon Sep 17 00:00:00 2001 From: Gregor Kleen Date: Sun, 17 Jul 2016 19:21:56 +0200 Subject: Fixes for GHC 8.0.1 --- webgui/src/Main.hs | 9 +++++---- webgui/thermoprint-webgui.cabal | 8 ++++---- 2 files changed, 9 insertions(+), 8 deletions(-) (limited to 'webgui') diff --git a/webgui/src/Main.hs b/webgui/src/Main.hs index a295fd9..252e933 100644 --- a/webgui/src/Main.hs +++ b/webgui/src/Main.hs @@ -86,6 +86,7 @@ config = do <*> (BaseUrl Http <$> Opt.strOption (Opt.long "target-addr" <> Opt.short 'A' <> Opt.metavar "HOST" <> Opt.help "Host to connect to" <> Opt.value "localhost" <> Opt.showDefault) <*> Opt.option Opt.auto (Opt.long "target-port" <> Opt.short 'P' <> Opt.metavar "PORT" <> Opt.help "Port to connect to" <> Opt.value 3000 <> Opt.showDefault) + <*> Opt.strOption (Opt.long "target-path" <> Opt.short 'F' <> Opt.metavar "PATH" <> Opt.help "Path we expect to find Thermoprint.Server under" <> Opt.value "" <> Opt.showDefault) ) where port def = Opt.long "port" @@ -151,8 +152,8 @@ setup Config{..} window (split -> (socketErr, dataUpdate)) = void $ do return (status, triggerStatusChange) Client{..} = mkClient (hoistNat $ Nat liftIO) server - withFatal :: EitherT ServantError UI a -> UI a - withFatal a = either (fatal . ("Error while communicating to Thermoprint.Server: " ++) . show) return =<< runEitherT a + withFatal :: ExceptT ServantError UI a -> UI a + withFatal a = either (fatal . ("Error while communicating to Thermoprint.Server: " ++) . show) return =<< runExceptT a handleEditor selectedPrinter (_, modifyFocusedJobs) = do title <- fatal' "Could not find editor title field" =<< getElementById window "editorTitle" @@ -256,7 +257,7 @@ setup Config{..} window (split -> (socketErr, dataUpdate)) = void $ do enactDeletion <- fatal' "Could not find deletion button" =<< getElementById window "enactDeletion" - on UI.click enactDeletion . const $ currentValue marking >>= mapM_ (runEitherT . draftDelete) >> updateMarking Set.empty + on UI.click enactDeletion . const $ currentValue marking >>= mapM_ (runExceptT . draftDelete) >> updateMarking Set.empty -- deletion' <- allowDeletion # get UI.checked let updateMarking' = callFunction (mangle <$> ffi getChecked) >>= updateMarking @@ -342,7 +343,7 @@ setup Config{..} window (split -> (socketErr, dataUpdate)) = void $ do (marking, (liftIO .) -> updateMarking) <- stepper' $ Set.empty enactAbortion <- fatal' "Could not find deletion button" =<< getElementById window "enactAbortion" - on UI.click enactAbortion . const $ currentValue marking >>= mapM_ (runEitherT . jobDelete) >> updateMarking Set.empty + on UI.click enactAbortion . const $ currentValue marking >>= mapM_ (runExceptT . jobDelete) >> updateMarking Set.empty (selectedPrinter, updatePrinter) <- do autoselectPrinter <- fatal' "Could not find printer autoselect switch" =<< getElementById window "autoselectPrinter" diff --git a/webgui/thermoprint-webgui.cabal b/webgui/thermoprint-webgui.cabal index 024bcf6..03aa9b2 100644 --- a/webgui/thermoprint-webgui.cabal +++ b/webgui/thermoprint-webgui.cabal @@ -2,7 +2,7 @@ -- documentation, see http://haskell.org/cabal/users-guide/ name: thermoprint-webgui -version: 0.0.0 +version: 1.0.0 synopsis: Threepenny interface for thermoprint-spec compliant servers -- description: homepage: http://dirty-haskell.org/tags/thermoprint.html @@ -25,9 +25,9 @@ executable thermoprint-webgui main-is: Main.hs -- other-modules: -- other-extensions: - build-depends: base >=4.8 && <4.9 - , thermoprint-bbcode >=1.0.0 && <2 - , thermoprint-client ==0.0.* + build-depends: base >=4.8 && <5 + , thermoprint-bbcode >=2.0.0 && <3 + , thermoprint-client ==1.0.* , threepenny-gui >=0.6.0 && <1 , optparse-applicative >=0.12.1 && <1 , bytestring >=0.10.6 && <1 -- cgit v1.2.3