diff options
Diffstat (limited to 'src/Main.hs')
-rw-r--r-- | src/Main.hs | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/src/Main.hs b/src/Main.hs index a6d80b3..f406f1b 100644 --- a/src/Main.hs +++ b/src/Main.hs @@ -3,6 +3,11 @@ module Main where import Control.Monad import Data.List import Data.Maybe +import qualified Data.Set as Set +import System.Environment +import System.Exit +import System.IO + import Haskell.AST import Haskell.Env import Haskell.Env.Cmd @@ -10,9 +15,6 @@ import Haskell.Env.Context import Haskell.Rewrite import Haskell.Parser import Pretty -import System.Environment -import System.Exit -import System.IO import Util @@ -115,7 +117,7 @@ applyUserCmd appstate = \case Just focus -> let nextStep ctx done = let orig = fromRight (get (topEnv ctx) focus) - in case filter (isRight . get (topEnv ctx)) $ allRefs orig \\ done of + in case filter (isRight . get (topEnv ctx)) $ Set.toList (freeVariables orig) \\ done of [] -> Right ctx (name:_) -> case apply ctx (Action (CRewrite name) focus) of Left err -> Left ("Error rewriting '" ++ name ++ "': " ++ err) |