Skip to content

Commit 60abb7a

Browse files
Merge #830: Clean-up
2 parents eb709cc + e9958d8 commit 60abb7a

File tree

8 files changed

+6
-16
lines changed

8 files changed

+6
-16
lines changed

src/Nix/Builtins.hs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@
1919
{-# LANGUAGE UndecidableInstances #-}
2020
{-# LANGUAGE ViewPatterns #-}
2121

22-
{-# OPTIONS_GHC -Wno-missing-signatures #-}
2322
{-# OPTIONS_GHC -fno-warn-name-shadowing #-}
2423

2524
-- | Code that implements Nix builtins. Lists the functions that are built into the Nix expression evaluator. Some built-ins (aka `derivation`), are always in the scope, so they can be accessed by the name. To keap the namespace clean, most built-ins are inside the `builtins` scope - a set that contains all what is a built-in.
@@ -660,6 +659,7 @@ splitMatches numDropped (((_, (start, len)) : captures) : mts) haystack =
660659
caps = nvList (map f captures)
661660
f (a, (s, _)) = if s < 0 then nvConstant NNull else thunkStr a
662661

662+
thunkStr :: Applicative f => ByteString -> NValue t f m
663663
thunkStr s = nvStr (makeNixStringWithoutContext (decodeUtf8 s))
664664

665665
substring :: forall e t f m. MonadNix e t f m => Int -> Int -> NixString -> Prim m NixString
@@ -1513,16 +1513,16 @@ newtype Prim m a = Prim { runPrim :: m a }
15131513

15141514
-- | Types that support conversion to nix in a particular monad
15151515
class ToBuiltin t f m a | a -> m where
1516-
toBuiltin :: String -> a -> m (NValue t f m)
1516+
toBuiltin :: String -> a -> m (NValue t f m)
15171517

15181518
instance (MonadNix e t f m, ToValue a m (NValue t f m))
1519-
=> ToBuiltin t f m (Prim m a) where
1519+
=> ToBuiltin t f m (Prim m a) where
15201520
toBuiltin _ p = toValue =<< runPrim p
15211521

15221522
instance ( MonadNix e t f m
15231523
, FromValue a m (Deeper (NValue t f m))
15241524
, ToBuiltin t f m b
15251525
)
1526-
=> ToBuiltin t f m (a -> b) where
1526+
=> ToBuiltin t f m (a -> b) where
15271527
toBuiltin name f =
15281528
pure $ nvBuiltin name (fromValue . Deeper >=> toBuiltin name . f)

src/Nix/Convert.hs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@
1313
{-# LANGUAGE TypeFamilies #-}
1414
{-# LANGUAGE UndecidableInstances #-}
1515

16-
{-# OPTIONS_GHC -Wno-missing-signatures #-}
1716
{-# OPTIONS_GHC -fno-warn-name-shadowing #-}
1817

1918
-- | Although there are a lot of instances in this file, really it's just a

src/Nix/Exec.hs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@
1515
{-# LANGUAGE TypeFamilies #-}
1616
{-# LANGUAGE UndecidableInstances #-}
1717

18-
{-# OPTIONS_GHC -Wno-missing-signatures #-}
1918
{-# OPTIONS_GHC -Wno-orphans #-}
2019
{-# OPTIONS_GHC -fno-warn-name-shadowing #-}
2120

src/Nix/Lint.hs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
{-# LANGUAGE AllowAmbiguousTypes #-}
21
{-# LANGUAGE ConstraintKinds #-}
32
{-# LANGUAGE DataKinds #-}
43
{-# LANGUAGE DeriveTraversable #-}

src/Nix/Thunk.hs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22
{-# LANGUAGE FlexibleContexts #-}
33
{-# LANGUAGE FunctionalDependencies #-}
44
{-# LANGUAGE TypeFamilies #-}
5-
{-# LANGUAGE UndecidableInstances #-}
65

76
module Nix.Thunk where
87

src/Nix/Value/Equal.hs

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@
77
{-# LANGUAGE DeriveTraversable #-}
88
{-# LANGUAGE FlexibleContexts #-}
99
{-# LANGUAGE FlexibleInstances #-}
10-
{-# LANGUAGE FunctionalDependencies #-}
1110
{-# LANGUAGE GADTs #-}
1211
{-# LANGUAGE LambdaCase #-}
1312
{-# LANGUAGE OverloadedStrings #-}
@@ -19,11 +18,9 @@
1918
{-# LANGUAGE TypeApplications #-}
2019
{-# LANGUAGE TypeFamilies #-}
2120
{-# LANGUAGE TypeOperators #-}
22-
{-# LANGUAGE UndecidableInstances #-}
2321
{-# LANGUAGE ViewPatterns #-}
2422

2523
{-# OPTIONS_GHC -Wno-orphans #-}
26-
{-# OPTIONS_GHC -Wno-missing-signatures #-}
2724
{-# OPTIONS_GHC -Wno-missing-pattern-synonym-signatures #-}
2825

2926
module Nix.Value.Equal where
@@ -90,7 +87,7 @@ isDerivationM f m = case M.lookup "type" m of
9087
Nothing -> pure False
9188

9289
isDerivation :: Monad m => (t -> Maybe NixString) -> AttrSet t -> Bool
93-
isDerivation f = runIdentity . isDerivationM (\x -> Identity (f x))
90+
isDerivation f = runIdentity . isDerivationM (Identity . f)
9491

9592
valueFEqM
9693
:: Monad n

tests/EvalTests.hs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,8 @@
33
{-# LANGUAGE QuasiQuotes #-}
44
{-# LANGUAGE ScopedTypeVariables #-}
55
{-# LANGUAGE TemplateHaskell #-}
6-
{-# LANGUAGE UndecidableInstances #-}
76

8-
{-# OPTIONS_GHC -Wno-missing-signatures -Wno-orphans #-}
7+
{-# OPTIONS_GHC -Wno-missing-signatures #-}
98

109
module EvalTests (tests, genEvalCompareTests) where
1110

tests/PrettyParseTests.hs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,7 @@
55
{-# LANGUAGE MonoLocalBinds #-}
66
{-# LANGUAGE NoMonomorphismRestriction #-}
77
{-# LANGUAGE OverloadedStrings #-}
8-
{-# LANGUAGE UndecidableInstances #-}
98

10-
{-# OPTIONS -Wno-orphans#-}
119

1210
module PrettyParseTests where
1311

0 commit comments

Comments
 (0)