Skip to content

Commit 598bac2

Browse files
committed
move instances {From,To}JSON NAtom to the parent
1 parent ae210ea commit 598bac2

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

src/Nix/Atoms.hs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ import Data.Text ( Text
1818
)
1919
import GHC.Generics
2020
import Data.Binary ( Binary )
21+
import Data.Aeson.Types ( FromJSON, ToJSON )
2122

2223
-- | Atoms are values that evaluate to themselves. This means that
2324
-- they appear in both the parsed AST (in the form of literals) and
@@ -42,6 +43,8 @@ instance Serialise NAtom
4243
#endif
4344

4445
instance Binary NAtom
46+
instance ToJSON NAtom
47+
instance FromJSON NAtom
4548

4649
-- | Translate an atom into its nix representation.
4750
atomText :: NAtom -> Text

src/Nix/Expr/Types.hs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -543,7 +543,6 @@ instance ToJSON Pos where
543543
instance ToJSON SourcePos
544544
instance ToJSON a => ToJSON (NKeyName a)
545545
instance ToJSON a => ToJSON (Params a)
546-
instance ToJSON NAtom
547546
instance ToJSON NUnaryOp
548547
instance ToJSON NBinaryOp
549548
instance ToJSON NRecordType
@@ -557,7 +556,6 @@ instance FromJSON Pos where
557556
instance FromJSON SourcePos
558557
instance FromJSON a => FromJSON (NKeyName a)
559558
instance FromJSON a => FromJSON (Params a)
560-
instance FromJSON NAtom
561559
instance FromJSON NUnaryOp
562560
instance FromJSON NBinaryOp
563561
instance FromJSON NRecordType

0 commit comments

Comments
 (0)