@@ -51,24 +51,24 @@ main = do
5151 runWithBasicEffectsIO opts $ case readFrom opts of
5252 Just path -> do
5353 let file = addExtension (dropExtension path) " nixc"
54- process opts (Just file) =<< liftIO (readCache path)
54+ process opts (pure file) =<< liftIO (readCache path)
5555 Nothing -> case expression opts of
56- Just s -> handleResult opts Nothing (parseNixTextLoc s)
56+ Just s -> handleResult opts mempty (parseNixTextLoc s)
5757 Nothing -> case fromFile opts of
5858 Just " -" -> mapM_ (processFile opts) . lines =<< liftIO getContents
5959 Just path ->
6060 mapM_ (processFile opts) . lines =<< liftIO (readFile path)
6161 Nothing -> case filePaths opts of
62- [] -> withNixContext Nothing Repl. main
62+ [] -> withNixContext mempty Repl. main
6363 [" -" ] ->
64- handleResult opts Nothing
64+ handleResult opts mempty
6565 . parseNixTextLoc
6666 =<< liftIO Text. getContents
6767 paths -> mapM_ (processFile opts) paths
6868 where
6969 processFile opts path = do
7070 eres <- parseNixFileLoc path
71- handleResult opts (Just path) eres
71+ handleResult opts (pure path) eres
7272
7373 handleResult opts mpath = \ case
7474 Failure err ->
@@ -77,14 +77,14 @@ main = do
7777 else errorWithoutStackTrace
7878 )
7979 $ " Parse failed: "
80- ++ show err
80+ <> show err
8181
8282 Success expr -> do
8383 when (check opts) $ do
8484 expr' <- liftIO (reduceExpr mpath expr)
8585 case HM. inferTop Env. empty [(" it" , stripAnnotation expr')] of
86- Left err -> errorWithoutStackTrace $ " Type error: " ++ PS. ppShow err
87- Right ty -> liftIO $ putStrLn $ " Type of expression: " ++ PS. ppShow
86+ Left err -> errorWithoutStackTrace $ " Type error: " <> PS. ppShow err
87+ Right ty -> liftIO $ putStrLn $ " Type of expression: " <> PS. ppShow
8888 (fromJust (Map. lookup " it" (Env. types ty)))
8989
9090 -- liftIO $ putStrLn $ runST $
@@ -102,8 +102,8 @@ main = do
102102 if evaluate opts
103103 then do
104104 val <- Nix. nixEvalExprLoc mpath expr
105- withNixContext Nothing (Repl. main' $ Just val)
106- else withNixContext Nothing Repl. main
105+ withNixContext mempty (Repl. main' $ pure val)
106+ else withNixContext mempty Repl. main
107107
108108 process opts mpath expr
109109 | evaluate opts
@@ -165,9 +165,9 @@ main = do
165165 where
166166 go prefix s = do
167167 xs <- forM (sortOn fst (M. toList s)) $ \ (k, nv) -> case nv of
168- Free v -> pure (k, Just (Free v))
168+ Free v -> pure (k, pure (Free v))
169169 Pure (StdThunk (extract -> Thunk _ _ ref)) -> do
170- let path = prefix ++ Text. unpack k
170+ let path = prefix <> Text. unpack k
171171 (_, descend) = filterEntry path k
172172 val <- readVar @ (StandardT (StdIdT IO )) ref
173173 case val of
@@ -176,14 +176,14 @@ main = do
176176 | otherwise -> pure (k, Nothing )
177177
178178 forM_ xs $ \ (k, mv) -> do
179- let path = prefix ++ Text. unpack k
179+ let path = prefix <> Text. unpack k
180180 (report, descend) = filterEntry path k
181181 when report $ do
182182 liftIO $ putStrLn path
183183 when descend $ case mv of
184184 Nothing -> pure ()
185185 Just v -> case v of
186- NVSet s' _ -> go (path ++ " ." ) s'
186+ NVSet s' _ -> go (path <> " ." ) s'
187187 _ -> pure ()
188188 where
189189 filterEntry path k = case (path, k) of
@@ -204,12 +204,12 @@ main = do
204204 _ -> (True , True )
205205
206206 forceEntry k v =
207- catch (Just <$> demand v pure ) $ \ (NixException frames) -> do
207+ catch (pure <$> demand v pure ) $ \ (NixException frames) -> do
208208 liftIO
209209 . putStrLn
210- . (" Exception forcing " ++ )
211- . (k ++ )
212- . (" : " ++ )
210+ . (" Exception forcing " <> )
211+ . (k <> )
212+ . (" : " <> )
213213 . show
214214 =<< renderFrames @ (StdValue (StandardT (StdIdT IO )))
215215 @ (StdThunk (StandardT (StdIdT IO )))
@@ -228,7 +228,7 @@ main = do
228228 -> m (NValue t f m )
229229 handleReduced path (expr', eres) = do
230230 liftIO $ do
231- putStrLn $ " Wrote winnowed expression tree to " ++ path
231+ putStrLn $ " Wrote winnowed expression tree to " <> path
232232 writeFile path $ show $ prettyNix (stripAnnotation expr')
233233 case eres of
234234 Left err -> throwM err
0 commit comments