Skip to content

Commit 1aa5b35

Browse files
committed
move TH instance Eq1 NValue' to the parent as derivable
Eq1 instance was previously derived as an orphan through TemplateHaskell. And that TH instance when moved into Nix.Value was breaking the NValue' data constructor deriving. So it is moved as derivable instance.
1 parent 4a609d6 commit 1aa5b35

File tree

2 files changed

+1
-4
lines changed

2 files changed

+1
-4
lines changed

src/Nix/Value.hs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -176,7 +176,7 @@ type MonadDataContext f (m :: * -> *)
176176
-- | At the time of constructor, the expected arguments to closures are values
177177
-- that may contain thunks. The type of such thunks are fixed at that time.
178178
newtype NValue' t f m a = NValue { _nValue :: f (NValueF (NValue t f m) m a) }
179-
deriving (Generic, Typeable, Functor, Foldable)
179+
deriving (Generic, Typeable, Functor, Foldable, Eq1)
180180

181181
instance (Comonad f, Show a) => Show (NValue' t f m a) where
182182
show (NValue (extract -> v)) = show v

src/Nix/Value/Equal.hs

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,6 @@ import Control.Monad.Free
3030
import Control.Monad.Trans.Class
3131
import Control.Monad.Trans.Except
3232
import Data.Align
33-
import Data.Eq.Deriving
3433
import Data.Functor.Identity
3534
import qualified Data.HashMap.Lazy as M
3635
import Data.These
@@ -173,5 +172,3 @@ thunkEqM lt rt = force lt $ \lv -> force rt $ \rv ->
173172
(NVList _ , NVList _ ) -> unsafePtrEq
174173
(NVSet _ _ , NVSet _ _ ) -> unsafePtrEq
175174
_ -> valueEqM lv rv
176-
177-
$(deriveEq1 ''NValue')

0 commit comments

Comments
 (0)