diff --git a/main/Repl.hs b/main/Repl.hs index 27229bd..3798691 100644 --- a/main/Repl.hs +++ b/main/Repl.hs @@ -166,7 +166,7 @@ initState mIni = do where evalText :: (MonadNix e t f m) => Text -> m (NValue t f m) evalText expr = case parseNixTextLoc expr of - Failure e -> error $ "Impossible happened: Unable to parse expression - '" ++ (Data.Text.unpack expr) ++ "' error was " ++ show e + Failure e -> error $ "Impossible happened: Unable to parse expression - '" ++ Data.Text.unpack expr ++ "' error was " ++ show e Success e -> do value <- evalExprLoc e pure value @@ -402,7 +402,7 @@ completeFunc reversedPrev word case Data.HashMap.Lazy.lookup f m of Nothing -> pure [] Just e -> - (demand e) + demand e (\e' -> fmap (("." <> f) <>) <$> algebraicComplete fs e') in case val of @@ -459,7 +459,7 @@ helpOptions = <> Prettyprinter.line <> "Available options:" <> Prettyprinter.line - <> (renderSetOptions helpSetOptions) + <> renderSetOptions helpSetOptions ) setConfig ] diff --git a/src/Nix/Builtins.hs b/src/Nix/Builtins.hs index 1a16f9f..f7b95c4 100644 --- a/src/Nix/Builtins.hs +++ b/src/Nix/Builtins.hs @@ -1378,7 +1378,7 @@ exec_ xs = do fetchurl :: forall e t f m . MonadNix e t f m => NValue t f m -> m (NValue t f m) fetchurl v = demand v $ \case - NVSet s _ -> attrsetGet "url" s >>= demand ?? (go (M.lookup "sha256" s)) + NVSet s _ -> attrsetGet "url" s >>= demand ?? go (M.lookup "sha256" s) v@NVStr{} -> go Nothing v v -> throwError diff --git a/src/Nix/Cited.hs b/src/Nix/Cited.hs index 0dae9e9..f993c5f 100644 --- a/src/Nix/Cited.hs +++ b/src/Nix/Cited.hs @@ -55,7 +55,7 @@ class HasCitations m v a where instance HasCitations m v (NCited m v a) where citations = _provenance - addProvenance x (NCited p v) = (NCited (x : p) v) + addProvenance x (NCited p v) = NCited (x : p) v class HasCitations1 m v f where citations1 :: f a -> [Provenance m v] diff --git a/src/Nix/Exec.hs b/src/Nix/Exec.hs index c685997..835f223 100644 --- a/src/Nix/Exec.hs +++ b/src/Nix/Exec.hs @@ -408,7 +408,7 @@ execBinaryOpForced scope span op lval rval = case op of (\rs2 -> nvStrP prov (ls `principledStringMappend` rs2)) <$> coerceToString callFunc CopyToStore CoerceStringy rs (NVPath ls, NVStr rs) -> case principledGetStringNoContext rs of - Just rs2 -> nvPathP prov <$> makeAbsolutePath @t @f (ls `mappend` (Text.unpack rs2)) + Just rs2 -> nvPathP prov <$> makeAbsolutePath @t @f (ls `mappend` Text.unpack rs2) Nothing -> throwError $ ErrorCall $ -- data/nix/src/libexpr/eval.cc:1412 "A string that refers to a store path cannot be appended to a path." @@ -431,7 +431,7 @@ execBinaryOpForced scope span op lval rval = case op of where prov :: Provenance m (NValue t f m) - prov = (Provenance scope (NBinary_ span op (Just lval) (Just rval))) + prov = Provenance scope (NBinary_ span op (Just lval) (Just rval)) toBool = pure . nvConstantP prov . NBool compare :: (forall a. Ord a => a -> a -> Bool) -> m (NValue t f m) diff --git a/src/Nix/Expr/Types/Annotated.hs b/src/Nix/Expr/Types/Annotated.hs index cd9866c..dbebeac 100644 --- a/src/Nix/Expr/Types/Annotated.hs +++ b/src/Nix/Expr/Types/Annotated.hs @@ -147,7 +147,7 @@ nSelectLoc :: NExprLoc -> Ann SrcSpan (NAttrPath NExprLoc) -> Maybe NExprLoc -> NExprLoc nSelectLoc e1@(AnnE s1 _) (Ann s2 ats) d = case d of Nothing -> AnnE (s1 <> s2) (NSelect e1 ats Nothing) - Just (e2@(AnnE s3 _)) -> AnnE (s1 <> s2 <> s3) (NSelect e1 ats (Just e2)) + Just e2@(AnnE s3 _) -> AnnE (s1 <> s2 <> s3) (NSelect e1 ats (Just e2)) _ -> error "nSelectLoc: unexpected" nSelectLoc _ _ _ = error "nSelectLoc: unexpected" diff --git a/src/Nix/Pretty.hs b/src/Nix/Pretty.hs index c3442d7..74a8f0f 100644 --- a/src/Nix/Pretty.hs +++ b/src/Nix/Pretty.hs @@ -409,8 +409,8 @@ printNix = iterNValue (\_ _ -> thk) phi where check v = fromMaybe v - ( (fmap (surround . show) (readMaybe v :: Maybe Int)) - <|> (fmap (surround . show) (readMaybe v :: Maybe Float)) + ( fmap (surround . show) (readMaybe v :: Maybe Int) + <|> fmap (surround . show) (readMaybe v :: Maybe Float) ) where surround s = "\"" ++ s ++ "\"" phi NVClosure'{} = "<>"