dynamic-graph 0.1.0.11 → 0.1.0.12
raw patch · 6 files changed
+28/−26 lines, 6 filesdep −eitherdep ~GLUtil
Dependencies removed: either
Dependency ranges changed: GLUtil
Files
- Graphics/DynamicGraph/FillLine.hs +5/−4
- Graphics/DynamicGraph/Line.hs +5/−4
- Graphics/DynamicGraph/Util.hs +0/−1
- Graphics/DynamicGraph/Waterfall.hs +5/−4
- Graphics/DynamicGraph/Window.hs +11/−10
- dynamic-graph.cabal +2/−3
Graphics/DynamicGraph/FillLine.hs view
@@ -5,7 +5,8 @@ Example usage: > import Control.Monad-> import Control.Monad.Trans.Either+> import Control.Monad.Trans.Except+> import Control.Error.Util > import Control.Concurrent > import Control.Applicative > import Pipes@@ -22,10 +23,10 @@ > threadDelay 10000 > return res > -> main = eitherT putStrLn return $ do+> main = exceptT putStrLn return $ do > res <- lift setupGLFW-> unless res (left "Unable to initilize GLFW")-> +> unless res (throwE "Unable to initilize GLFW")+> > lineGraph <- window 1024 480 $ pipeify <$> renderFilledLine 1000 jet_mod > > lift $ runEffect $ randomVect >-> lineGraph
Graphics/DynamicGraph/Line.hs view
@@ -7,7 +7,8 @@ Example usage: > import Control.Monad-> import Control.Monad.Trans.Either+> import Control.Monad.Trans.Except+> import Control.Error.Util > import Control.Concurrent > import Control.Applicative > import Pipes@@ -24,10 +25,10 @@ > threadDelay 10000 > return res > -> main = eitherT putStrLn return $ do+> main = exceptT putStrLn return $ do > res <- lift setupGLFW-> unless res (left "Unable to initilize GLFW")-> +> unless res (throwE "Unable to initilize GLFW")+> > lineGraph <- window 1024 480 $ pipeify <$> renderLine 1000 1024 > > lift $ runEffect $ randomVect >-> lineGraph
Graphics/DynamicGraph/Util.hs view
@@ -8,7 +8,6 @@ import Control.Monad import Control.Monad.Trans.Class-import Control.Monad.Trans.Either import Control.Concurrent.MVar import Control.Applicative
Graphics/DynamicGraph/Waterfall.hs view
@@ -5,7 +5,8 @@ Example usage: > import Control.Monad-> import Control.Monad.Trans.Either+> import Control.Monad.Trans.Except+> import Control.Error.Util > import Control.Concurrent > import Pipes > import qualified Pipes.Prelude as P@@ -21,10 +22,10 @@ > threadDelay 10000 > return res > -> main = eitherT putStrLn return $ do+> main = exceptT putStrLn return $ do > res <- lift setupGLFW-> unless res (left "Unable to initilize GLFW")-> +> unless res (throwE "Unable to initilize GLFW")+> > waterfall <- window 1024 480 $ renderWaterfall 1000 1000 jet_mod > > lift $ runEffect $ randomVect >-> waterfall
Graphics/DynamicGraph/Window.hs view
@@ -5,7 +5,8 @@ Example usage: > import Control.Monad-> import Control.Monad.Trans.Either+> import Control.Monad.Trans.Except+> import Control.Error.Util > import Control.Concurrent > import Pipes > import qualified Pipes.Prelude as P@@ -21,10 +22,10 @@ > threadDelay 10000 > return res > -> main = eitherT putStrLn return $ do+> main = exceptT putStrLn return $ do > res <- lift setupGLFW-> unless res (left "Unable to initilize GLFW")->+> unless res (throwE "Unable to initilize GLFW")+> > waterfall <- window 1024 480 $ renderWaterfall 1000 1000 jet_mod > > lift $ runEffect $ randomVect >-> waterfall@@ -35,7 +36,7 @@ module Graphics.DynamicGraph.Util ) where -import Control.Monad.Trans.Either+import Control.Monad.Trans.Except import Control.Concurrent hiding (yield) import Control.Concurrent.MVar import Data.IORef@@ -58,7 +59,7 @@ => Int -- ^ Window width -> Int -- ^ Window height -> IO (Consumer a IO ()) -- ^ The Consumer that draws on the window. Obtain this from one of the other modules in this package. Must be given in an IO monad so that it can be initialised with the OpenGL context created within this function.- -> EitherT String IO (Consumer a IO ()) + -> ExceptT String IO (Consumer a IO ()) window width height renderPipe = do mv :: MVar a <- lift newEmptyMVar completion <- lift newEmptyMVar@@ -66,9 +67,9 @@ closed <- lift $ newIORef False lift $ forkIO $ void $ do- res <- runEitherT $ do+ res <- runExceptT $ do res' <- lift $ createWindow width height "" Nothing Nothing- win <- maybe (left "error creating window") return res'+ win <- maybe (throwE "error creating window") return res' lift $ setWindowSizeCallback win $ Just $ \win x y -> viewport $= (Position 0 0, Size (fromIntegral x) (fromIntegral y)) lift $ setWindowCloseCallback win $ Just $ \win -> writeIORef closed True@@ -88,9 +89,9 @@ return $ runEffect $ thePipe >-> renderPipe case res of- Left err -> replaceMVar completion $ left err+ Left err -> replaceMVar completion $ throwE err Right renderLoop -> do- replaceMVar completion $ right ()+ replaceMVar completion $ return () renderLoop join $ lift $ takeMVar completion
dynamic-graph.cabal view
@@ -1,5 +1,5 @@ name: dynamic-graph-version: 0.1.0.11+version: 0.1.0.12 synopsis: Draw and update graphs in real time with OpenGL description: Draw and update graphs in real time with OpenGL. Suitable for displaying large amounts of frequently changing data. Line graphs and waterfall plots are supported, as well as axis drawing.@@ -40,9 +40,8 @@ base >=4.6 && <5, GLFW-b >=1.4 && <1.5, OpenGL >=2.9 && <3.1, - GLUtil >=0.9.1 && <0.10, + GLUtil >=0.9.1 && <0.11, transformers >=0.3 && <0.6, - either >=4.1 && <4.5, pipes >=4.1 && <4.4, pango >=0.13 && <0.14, cairo >=0.13 && <0.14,