git.iko.soy/typeable/postgresql-simple
on master help sign in
Add "instance (Result a, Result b) => Result (Either a b)"
2172aecLeon P Smith
src/Database/PostgreSQL/Simple/Result.hs+8
@@ -200,6 +200,14 @@ instance Result TimeOfDay where
200 case makeTimeOfDayValid hours mins (fromIntegral secs) of
200 case makeTimeOfDayValid hours mins (fromIntegral secs) of
201 Just t -> return (pure t)
201 Just t -> return (pure t)
202 _ -> return (returnError ConversionFailed f "could not parse")
202 _ -> return (returnError ConversionFailed f "could not parse")
203+
204+instance (Result a, Result b) => Result (Either a b) where
205+ convert f dat = case convert f dat of
206+ Right x -> Right (Right x)
207+ Left _ -> case convert f dat of
208+ Right x -> Right (Left x)
209+ Left e -> Left e
210+
203newtype Compat = Compat Word64
211newtype Compat = Compat Word64
204
212
205mkCompats :: [BuiltinType] -> Compat
213mkCompats :: [BuiltinType] -> Compat