diff options
author | Julien Dessaux | 2023-07-19 22:04:46 +0200 |
---|---|---|
committer | Julien Dessaux | 2023-07-19 22:04:46 +0200 |
commit | b76382337697d180f81a8bf0da2cd978b1613aba (patch) | |
tree | c451c3ebbf221d0c46bef7f8068593400619d3d3 /haskell/src/SpaceTraders/Model/System.hs | |
parent | [haskell] refactoring (diff) | |
download | spacetraders-b76382337697d180f81a8bf0da2cd978b1613aba.tar.gz spacetraders-b76382337697d180f81a8bf0da2cd978b1613aba.tar.bz2 spacetraders-b76382337697d180f81a8bf0da2cd978b1613aba.zip |
[haskell] Fixed models' serialization
Diffstat (limited to '')
-rw-r--r-- | haskell/src/SpaceTraders/Model/System.hs | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/haskell/src/SpaceTraders/Model/System.hs b/haskell/src/SpaceTraders/Model/System.hs index dacd27a..0092ef5 100644 --- a/haskell/src/SpaceTraders/Model/System.hs +++ b/haskell/src/SpaceTraders/Model/System.hs @@ -29,9 +29,9 @@ instance FromJSON System where <*> o .: "y" <*> o .: "waypoints" instance ToJSON System where - toEncoding (System ss s t xx yy w) = pairs ( "sectorSymbol" .= ss - <> "symbol" .= s - <> "type" .= t - <> "x" .= xx - <> "y" .= yy - <> "waypoints" .= w ) + toJSON (System ss s t xx yy w) = object [ "sectorSymbol" .= ss + , "symbol" .= s + , "type" .= t + , "x" .= xx + , "y" .= yy + , "waypoints" .= w ] |