on master help sign in
Unified two GFromProduct instances
3e2d9caBas van Dijk
Data/Aeson/Types/Internal.hs+1−3
@@ -1011,12 +1011,10 @@ instance (GFromProduct a, GFromProduct b) => GFromProduct (a :*: b) where
1011 where
1011 where
1012 (arrL, arrR) = V.splitAt (V.length arr `div` 2) arr
1012 (arrL, arrR) = V.splitAt (V.length arr `div` 2) arr
1013
1013
1014−instance (GFromJSON a) => GFromProduct (S1 NoSelector a) where
1014+instance (GFromJSON a) => GFromProduct a where
1015 gParseProduct ((!? 0) -> Just v) = gParseJSON v
1015 gParseProduct ((!? 0) -> Just v) = gParseJSON v
1016 gParseProduct _ = fail "Array to small"
1016 gParseProduct _ = fail "Array to small"
1017
1017
1018−instance GFromProduct (M1 i c f) where gParseProduct = undefined
1019−
1020--------------------------------------------------------------------------------
1018--------------------------------------------------------------------------------
1021
1019
1022class GObject f where
1020class GObject f where