From b76382337697d180f81a8bf0da2cd978b1613aba Mon Sep 17 00:00:00 2001 From: Julien Dessaux Date: Wed, 19 Jul 2023 22:04:46 +0200 Subject: [haskell] Fixed models' serialization --- haskell/src/SpaceTraders/Model/Waypoint.hs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'haskell/src/SpaceTraders/Model/Waypoint.hs') diff --git a/haskell/src/SpaceTraders/Model/Waypoint.hs b/haskell/src/SpaceTraders/Model/Waypoint.hs index d18cc11..458df21 100644 --- a/haskell/src/SpaceTraders/Model/Waypoint.hs +++ b/haskell/src/SpaceTraders/Model/Waypoint.hs @@ -22,7 +22,7 @@ instance FromJSON Waypoint where <*> o .: "x" <*> o .: "y" instance ToJSON Waypoint where - toEncoding (Waypoint s t xx yy) = pairs ( "symbol" .= s - <> "type" .= t - <> "x" .= xx - <> "y" .= yy ) + toJSON (Waypoint s t xx yy) = object [ "symbol" .= s + , "type" .= t + , "x" .= xx + , "y" .= yy ] -- cgit v1.2.3