summaryrefslogtreecommitdiff
path: root/haskell/src/SpaceTraders/Model/System.hs
diff options
context:
space:
mode:
authorJulien Dessaux2023-07-19 22:04:46 +0200
committerJulien Dessaux2023-07-19 22:04:46 +0200
commitb76382337697d180f81a8bf0da2cd978b1613aba (patch)
treec451c3ebbf221d0c46bef7f8068593400619d3d3 /haskell/src/SpaceTraders/Model/System.hs
parent[haskell] refactoring (diff)
downloadspacetraders-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.hs12
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 ]