Skip to content

Commit 12a98fd

Browse files
committed
move instances {From,To}JSON NAtom to the parent
1 parent 3347932 commit 12a98fd

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
@@ -537,7 +537,6 @@ instance ToJSON Pos where
537537
instance ToJSON SourcePos
538538
instance ToJSON a => ToJSON (NKeyName a)
539539
instance ToJSON a => ToJSON (Params a)
540-
instance ToJSON NAtom
541540
instance ToJSON NUnaryOp
542541
instance ToJSON NBinaryOp
543542
instance ToJSON NRecordType
@@ -551,7 +550,6 @@ instance FromJSON Pos where
551550
instance FromJSON SourcePos
552551
instance FromJSON a => FromJSON (NKeyName a)
553552
instance FromJSON a => FromJSON (Params a)
554-
instance FromJSON NAtom
555553
instance FromJSON NUnaryOp
556554
instance FromJSON NBinaryOp
557555
instance FromJSON NRecordType

0 commit comments

Comments
 (0)