refactor: remove Maybe from RetType for Proc type

This commit is contained in:
steve-chavez
2023-04-04 19:55:10 -05:00
committed by Steve Chavez
parent bc1fb67df0
commit d945e8c06a
2 changed files with 15 additions and 15 deletions
+5 -5
View File
@@ -255,16 +255,16 @@ decodeProcs =
addKey :: ProcDescription -> (QualifiedIdentifier, ProcDescription)
addKey pd = (QualifiedIdentifier (pdSchema pd) (pdName pd), pd)
parseRetType :: Text -> Text -> Bool -> Bool -> Bool -> Maybe RetType
parseRetType :: Text -> Text -> Bool -> Bool -> Bool -> RetType
parseRetType schema name isSetOf isComposite isVoid
| isVoid = Nothing
| isSetOf = Just (SetOf pgType)
| otherwise = Just (Single pgType)
| isVoid = Single $ Scalar True
| isSetOf = SetOf pgType
| otherwise = Single pgType
where
qi = QualifiedIdentifier schema name
pgType
| isComposite = Composite qi
| otherwise = Scalar
| otherwise = Scalar False
parseVolatility :: Char -> ProcVolatility
parseVolatility v | v == 'i' = Immutable