implemented password changing

This commit is contained in:
Jonathan Lamothe
2018-12-26 15:43:13 -05:00
parent 0f6cbc0b24
commit 318079dca8
2 changed files with 19 additions and 3 deletions

View File

@@ -20,7 +20,7 @@ License along with this program. If not, see
-}
module Util (menu, req, tryReq, confirm) where
module Util (menu, run, req, tryReq, confirm) where
import Control.Monad (join)
import Control.Monad.Trans.Class (lift)
@@ -52,6 +52,9 @@ menuItem (str, x) = (str, return x)
reqState :: Request (S.StateT s IO a) -> S.StateT s IO a
reqState = join . req
run :: Monad m => (s -> (a, s)) -> S.StateT s m a
run f = S.StateT $ return . f
req :: Request a -> S.StateT s IO a
req = lift . fmap fromJust . runRequest . required