1
1
mirror of https://github.com/github/semantic.git synced 2024-12-27 17:05:33 +03:00
This commit is contained in:
Ayman Nadeem 2020-01-21 16:11:42 -05:00
parent 164672e52a
commit 5970982065

View File

@ -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 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 -- 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 -- Fold over S1 product types and pass the result to Aeson objects
instance GFields fields => GFields (C1 c fields) where instance GFields fields => GFields (C1 c fields) where
gfields acc x = gfields acc (unM1 x) gfields acc x = gfields acc (unM1 x)