Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove overlapping [From,To]JSON instances for NExpr #699

Merged
merged 1 commit into from
Aug 19, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion hnix.cabal
Original file line number Diff line number Diff line change
Expand Up @@ -384,7 +384,7 @@ library
src
ghc-options: -Wall -fprint-potential-instances
build-depends:
aeson >= 1.4.2 && < 1.5.3
aeson >= 1.4.2 && < 1.6
, array >= 0.4 && < 0.6
, base >= 4.11 && < 5
, binary >= 0.8.5 && < 0.9
Expand Down
4 changes: 1 addition & 3 deletions main/Main.hs
Original file line number Diff line number Diff line change
Expand Up @@ -17,15 +17,13 @@ import Control.Monad.Catch
import Control.Monad.Free
import Control.Monad.IO.Class
-- import Control.Monad.ST
import qualified Data.Aeson.Text as A
import qualified Data.HashMap.Lazy as M
import qualified Data.Map as Map
import Data.List ( sortOn )
import Data.Maybe ( fromJust )
import Data.Time
import qualified Data.Text as Text
import qualified Data.Text.IO as Text
import qualified Data.Text.Lazy.IO as TL
import Nix
import Nix.Convert
import qualified Nix.Eval as Eval
Expand Down Expand Up @@ -124,7 +122,7 @@ main = do
| xml opts
= error "Rendering expression trees to XML is not yet implemented"
| json opts
= liftIO $ TL.putStrLn $ A.encodeToLazyText (stripAnnotation expr)
= error "Rendering expression trees to JSON is not implemented"
| verbose opts >= DebugInfo
= liftIO $ putStr $ PS.ppShow $ stripAnnotation expr
| cache opts
Expand Down
2 changes: 0 additions & 2 deletions src/Nix/Expr/Types.hs
Original file line number Diff line number Diff line change
Expand Up @@ -543,7 +543,6 @@ instance ToJSON NUnaryOp
instance ToJSON NBinaryOp
instance ToJSON NRecordType
instance ToJSON a => ToJSON (NExprF a)
instance ToJSON NExpr

instance (FromJSON v, FromJSON a) => FromJSON (Antiquoted v a)
instance FromJSON a => FromJSON (NString a)
Expand All @@ -558,7 +557,6 @@ instance FromJSON NUnaryOp
instance FromJSON NBinaryOp
instance FromJSON NRecordType
instance FromJSON a => FromJSON (NExprF a)
instance FromJSON NExpr

$(makeTraversals ''NExprF)
$(makeTraversals ''Binding)
Expand Down