From 5970982065d12cca21814fb716f7e4df8d021da0 Mon Sep 17 00:00:00 2001 From: Ayman Nadeem Date: Tue, 21 Jan 2020 16:11:42 -0500 Subject: [PATCH] TODOs --- semantic-ast/src/Marshal/JSON.hs | 3 +++ 1 file changed, 3 insertions(+) diff --git a/semantic-ast/src/Marshal/JSON.hs b/semantic-ast/src/Marshal/JSON.hs index 7f1636c2e..294e6b4f9 100644 --- a/semantic-ast/src/Marshal/JSON.hs +++ b/semantic-ast/src/Marshal/JSON.hs @@ -39,6 +39,9 @@ instance (GFields f, Datatype c) => GFields (M1 D c f) where gfields acc x = gfields ((Text.pack "type", String (Text.pack (datatypeName x))): acc) $ unM1 x -- gmarshal = gmarshal . unM1 -- using unM1 instead of pattern-matching on M1 in order to express with function composition +-- 1. Need to get the name of the datatype. +-- 2. Pass info along somewhere where we can do something with it. + -- Fold over S1 product types and pass the result to Aeson objects instance GFields fields => GFields (C1 c fields) where gfields acc x = gfields acc (unM1 x)