Updated hledger-ui to use brick-0.16 (#479)
brick-0.16 uses Brick.BChan.BChan instead of Control.Concurrent.Chan.Chan.
This commit is contained in:
		
							parent
							
								
									8bc67d5ee8
								
							
						
					
					
						commit
						d3883bad1f
					
				| @ -3,6 +3,7 @@ hledger-ui - a hledger add-on providing a curses-style interface. | |||||||
| Copyright (c) 2007-2015 Simon Michael <simon@joyful.com> | Copyright (c) 2007-2015 Simon Michael <simon@joyful.com> | ||||||
| Released under GPL version 3 or later. | Released under GPL version 3 or later. | ||||||
| -} | -} | ||||||
|  | {-# LANGUAGE CPP #-} | ||||||
| {-# LANGUAGE OverloadedStrings #-} | {-# LANGUAGE OverloadedStrings #-} | ||||||
| {-# LANGUAGE TemplateHaskell #-} | {-# LANGUAGE TemplateHaskell #-} | ||||||
| {-# LANGUAGE MultiParamTypeClasses #-} | {-# LANGUAGE MultiParamTypeClasses #-} | ||||||
| @ -11,12 +12,12 @@ module Hledger.UI.Main where | |||||||
| 
 | 
 | ||||||
| -- import Control.Applicative | -- import Control.Applicative | ||||||
| -- import Lens.Micro.Platform ((^.)) | -- import Lens.Micro.Platform ((^.)) | ||||||
| import Control.Concurrent | import Control.Concurrent (threadDelay) | ||||||
| import Control.Concurrent.Async | import Control.Concurrent.Async | ||||||
| import Control.Monad | import Control.Monad | ||||||
| -- import Control.Monad.IO.Class (liftIO) | -- import Control.Monad.IO.Class (liftIO) | ||||||
| import Data.Default (def) | import Data.Default (def) | ||||||
| -- import Data.Monoid              --  | -- import Data.Monoid              -- | ||||||
| import Data.List | import Data.List | ||||||
| import Data.Maybe | import Data.Maybe | ||||||
| -- import Data.Text (Text) | -- import Data.Text (Text) | ||||||
| @ -30,6 +31,12 @@ import System.FilePath | |||||||
| import System.FSNotify | import System.FSNotify | ||||||
| import Brick | import Brick | ||||||
| 
 | 
 | ||||||
|  | #if MIN_VERSION_brick(0,16,0) | ||||||
|  | import qualified Brick.BChan as BC | ||||||
|  | #else | ||||||
|  | import Control.Concurrent.Chan (newChan, writeChan) | ||||||
|  | #endif | ||||||
|  | 
 | ||||||
| import Hledger | import Hledger | ||||||
| import Hledger.Cli hiding (progname,prognameandversion,green) | import Hledger.Cli hiding (progname,prognameandversion,green) | ||||||
| import Hledger.UI.UIOptions | import Hledger.UI.UIOptions | ||||||
| @ -41,6 +48,15 @@ import Hledger.UI.RegisterScreen | |||||||
| 
 | 
 | ||||||
| ---------------------------------------------------------------------- | ---------------------------------------------------------------------- | ||||||
| 
 | 
 | ||||||
|  | #if MIN_VERSION_brick(0,16,0) | ||||||
|  | newChan :: IO (BC.BChan a) | ||||||
|  | newChan = BC.newBChan 10 | ||||||
|  | 
 | ||||||
|  | writeChan :: BC.BChan a -> a -> IO () | ||||||
|  | writeChan = BC.writeBChan | ||||||
|  | #endif | ||||||
|  | 
 | ||||||
|  | 
 | ||||||
| main :: IO () | main :: IO () | ||||||
| main = do | main = do | ||||||
|   opts <- getHledgerUIOpts |   opts <- getHledgerUIOpts | ||||||
| @ -129,7 +145,7 @@ runBrickUi uopts@UIOpts{cliopts_=copts@CliOpts{reportopts_=ropts}} j = do | |||||||
|                    ,aPrevScreens=[] |                    ,aPrevScreens=[] | ||||||
|                    ,aMode=Normal |                    ,aMode=Normal | ||||||
|                    } |                    } | ||||||
|    | 
 | ||||||
|     ui = |     ui = | ||||||
|       (sInit scr) d True $ |       (sInit scr) d True $ | ||||||
|         (if change_ uopts' then toggleHistorical else id) $ -- XXX |         (if change_ uopts' then toggleHistorical else id) $ -- XXX | ||||||
|  | |||||||
| @ -85,7 +85,7 @@ executable hledger-ui | |||||||
|     buildable: False |     buildable: False | ||||||
|   else |   else | ||||||
|     build-depends: |     build-depends: | ||||||
|         brick >= 0.12 && < 0.16 |         brick >= 0.12 && < 0.17 | ||||||
|       , vty >= 5.5 && < 5.15 |       , vty >= 5.5 && < 5.15 | ||||||
|   if flag(threaded) |   if flag(threaded) | ||||||
|     ghc-options: -threaded |     ghc-options: -threaded | ||||||
|  | |||||||
| @ -88,7 +88,7 @@ executables: | |||||||
|           buildable: false |           buildable: false | ||||||
|         else: |         else: | ||||||
|           dependencies: |           dependencies: | ||||||
|             - brick >= 0.12 && < 0.16 |             - brick >= 0.12 && < 0.17 | ||||||
|             - vty >= 5.5 && < 5.15 |             - vty >= 5.5 && < 5.15 | ||||||
|       - condition: flag(threaded) |       - condition: flag(threaded) | ||||||
|         ghc-options: -threaded |         ghc-options: -threaded | ||||||
|  | |||||||
| @ -11,7 +11,7 @@ packages: | |||||||
| 
 | 
 | ||||||
| extra-deps: | extra-deps: | ||||||
| # for hledger-ui: | # for hledger-ui: | ||||||
| - brick-0.15.2 | - brick-0.16 | ||||||
| - vty-5.14 | - vty-5.14 | ||||||
| - text-zipper-0.8.1 | - text-zipper-0.8.1 | ||||||
| # for hledger-web: | # for hledger-web: | ||||||
|  | |||||||
		Loading…
	
		Reference in New Issue
	
	Block a user