user friendliness fixes
- use full sentences - better menu flow
This commit is contained in:
15
app/Util.hs
15
app/Util.hs
@@ -20,9 +20,17 @@ License along with this program. If not, see
|
||||
|
||||
-}
|
||||
|
||||
module Util (menu, run, withService, req, tryReq, confirm) where
|
||||
module Util
|
||||
( menu
|
||||
, run
|
||||
, withService
|
||||
, setService
|
||||
, req
|
||||
, tryReq
|
||||
, confirm
|
||||
) where
|
||||
|
||||
import Control.Lens (view)
|
||||
import Control.Lens (over, view)
|
||||
import Control.Monad (join)
|
||||
import Control.Monad.Trans.Class (lift)
|
||||
import qualified Control.Monad.Trans.State as S
|
||||
@@ -69,6 +77,9 @@ withService srv fb act = do
|
||||
Nothing -> fb
|
||||
Just x -> act x
|
||||
|
||||
setService :: String -> PWData -> S.StateT Status IO ()
|
||||
setService k = S.modify . over database . pwSetService k
|
||||
|
||||
req :: Request a -> S.StateT s IO a
|
||||
req = lift . fmap fromJust . runRequest . required
|
||||
|
||||
|
||||
Reference in New Issue
Block a user