Open clojurians-org opened 4 years ago
i use Label to resolve it. i want to know whether exist a general FromJSON version
instance (KnownSymbol s, J.FromJSON a, J.FromJSON (V.FieldRec rs))
=> J.FromJSON (V.FieldRec (s ::: a ': rs)) where
parseJSON o@(J.Object v) = do
f :: a <- v .: cs (symbolVal (Proxy :: Proxy s))
rest <- J.parseJSON o
pure $ ((V.Label:: V.Label s)=: f) :& rest
i read the ToJSON example: https://github.com/VinylRecords/Vinyl/blob/master/tests/Aeson.hs
and i want to implement FromJSON, i have no idea how to offer the label value. for
pure $ (undefined =: f) :& rest