diff --git a/beam-core/Database/Beam/Backend/SQL/Row.hs b/beam-core/Database/Beam/Backend/SQL/Row.hs index 28401cce..175066c2 100644 --- a/beam-core/Database/Beam/Backend/SQL/Row.hs +++ b/beam-core/Database/Beam/Backend/SQL/Row.hs @@ -102,6 +102,8 @@ class BeamBackend be => FromBackendRow be a where valuesNeeded :: Proxy be -> Proxy a -> Int valuesNeeded _ _ = 1 +deriving instance FromBackendRow be a => FromBackendRow be (Identity a) + class GFromBackendRow be (exposed :: Type -> Type) rep where gFromBackendRow :: Proxy exposed -> FromBackendRowM be (rep ()) gValuesNeeded :: Proxy be -> Proxy exposed -> Proxy rep -> Int @@ -117,6 +119,9 @@ instance (GFromBackendRow be aExp a, GFromBackendRow be bExp b) => GFromBackendR instance FromBackendRow be x => GFromBackendRow be (K1 R (Exposed x)) (K1 R x) where gFromBackendRow _ = K1 <$> fromBackendRow gValuesNeeded be _ _ = valuesNeeded be (Proxy @x) +instance FromBackendRow be x => GFromBackendRow be (K1 R (Exposed x)) (K1 R (Identity x)) where + gFromBackendRow _ = K1 <$> fromBackendRow + gValuesNeeded be _ _ = valuesNeeded be (Proxy @x) instance FromBackendRow be (t Identity) => GFromBackendRow be (K1 R (t Exposed)) (K1 R (t Identity)) where gFromBackendRow _ = K1 <$> fromBackendRow gValuesNeeded be _ _ = valuesNeeded be (Proxy @(t Identity))