Skip to content

Commit

Permalink
Move where clause to let
Browse files Browse the repository at this point in the history
so that it can capture the existing `accounts` binding.
  • Loading branch information
MoritzR committed Aug 23, 2023
1 parent b8b7d6b commit f5b85a1
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions src/Completion.hs
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,8 @@ runCompletion config key
runWithAccountCompletion :: AppConfig -> InputT IO a -> IO a
runWithAccountCompletion config input = do
accounts <- getAccounts config.journalFile
runInputT (makeSettings $ accountCompletion accounts) input
where
accountCompletion accounts = completeWord Nothing [] (return . getCompletions accounts . pack)
let accountCompletion = completeWord Nothing [] (return . getCompletions accounts . pack)
runInputT (makeSettings accountCompletion) input

runWithNoCompletion :: InputT IO a -> IO a
runWithNoCompletion = runInputT $ makeSettings noCompletion
Expand Down

0 comments on commit f5b85a1

Please sign in to comment.