ui: fix some of the hlint warnings
This commit is contained in:
parent
a8933e8c5c
commit
0da68d2cb8
@ -5,7 +5,6 @@ Released under GPL version 3 or later.
|
|||||||
-}
|
-}
|
||||||
{-# LANGUAGE CPP #-}
|
{-# LANGUAGE CPP #-}
|
||||||
{-# LANGUAGE OverloadedStrings #-}
|
{-# LANGUAGE OverloadedStrings #-}
|
||||||
{-# LANGUAGE TemplateHaskell #-}
|
|
||||||
{-# LANGUAGE MultiParamTypeClasses #-}
|
{-# LANGUAGE MultiParamTypeClasses #-}
|
||||||
|
|
||||||
module Hledger.UI.Main where
|
module Hledger.UI.Main where
|
||||||
@ -142,27 +141,27 @@ runBrickUi uopts@UIOpts{cliopts_=copts@CliOpts{reportopts_=ropts}} j = do
|
|||||||
-- Initialising the accounts screen is awkward, requiring
|
-- Initialising the accounts screen is awkward, requiring
|
||||||
-- another temporary UIState value..
|
-- another temporary UIState value..
|
||||||
ascr' = aScreen $
|
ascr' = aScreen $
|
||||||
asInit d True $
|
asInit d True
|
||||||
UIState{
|
UIState{
|
||||||
aopts=uopts'
|
aopts=uopts'
|
||||||
,ajournal=j
|
,ajournal=j
|
||||||
,aScreen=asSetSelectedAccount acct accountsScreen
|
,aScreen=asSetSelectedAccount acct accountsScreen
|
||||||
,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
|
||||||
UIState{
|
UIState{
|
||||||
aopts=uopts'
|
aopts=uopts'
|
||||||
,ajournal=j
|
,ajournal=j
|
||||||
,aScreen=scr
|
,aScreen=scr
|
||||||
,aPrevScreens=prevscrs
|
,aPrevScreens=prevscrs
|
||||||
,aMode=Normal
|
,aMode=Normal
|
||||||
}
|
}
|
||||||
|
|
||||||
brickapp :: App (UIState) AppEvent Name
|
brickapp :: App UIState AppEvent Name
|
||||||
brickapp = App {
|
brickapp = App {
|
||||||
appStartEvent = return
|
appStartEvent = return
|
||||||
, appAttrMap = const theme
|
, appAttrMap = const theme
|
||||||
@ -194,7 +193,7 @@ runBrickUi uopts@UIOpts{cliopts_=copts@CliOpts{reportopts_=ropts}} j = do
|
|||||||
|
|
||||||
withAsync
|
withAsync
|
||||||
(getCurrentDay >>= watchDate)
|
(getCurrentDay >>= watchDate)
|
||||||
$ \_ -> do
|
$ \_ ->
|
||||||
|
|
||||||
-- start one or more background threads reporting changes in the directories of our files
|
-- start one or more background threads reporting changes in the directories of our files
|
||||||
-- XXX many quick successive saves causes the problems listed in BUGS
|
-- XXX many quick successive saves causes the problems listed in BUGS
|
||||||
@ -205,7 +204,7 @@ runBrickUi uopts@UIOpts{cliopts_=copts@CliOpts{reportopts_=ropts}} j = do
|
|||||||
-- but gets tied up for ages
|
-- but gets tied up for ages
|
||||||
withManager $ \mgr -> do
|
withManager $ \mgr -> do
|
||||||
dbg1IO "fsnotify using polling ?" $ isPollingManager mgr
|
dbg1IO "fsnotify using polling ?" $ isPollingManager mgr
|
||||||
files <- mapM canonicalizePath $ map fst $ jfiles j
|
files <- mapM (canonicalizePath . fst) $ jfiles j
|
||||||
let directories = nub $ sort $ map takeDirectory files
|
let directories = nub $ sort $ map takeDirectory files
|
||||||
dbg1IO "files" files
|
dbg1IO "files" files
|
||||||
dbg1IO "directories to watch" directories
|
dbg1IO "directories to watch" directories
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user