Add isScalarType.

This commit is contained in:
Adam Sampson 2008-03-22 00:53:13 +00:00
parent 321e52dd65
commit 56de093739

View File

@ -20,7 +20,7 @@ with this program. If not, see <http://www.gnu.org/licenses/>.
module Types module Types
( (
specTypeOfName, typeOfSpec, abbrevModeOfName, typeOfName, typeOfExpression, typeOfVariable, underlyingType, stripArrayType, abbrevModeOfVariable, abbrevModeOfSpec specTypeOfName, typeOfSpec, abbrevModeOfName, typeOfName, typeOfExpression, typeOfVariable, underlyingType, stripArrayType, abbrevModeOfVariable, abbrevModeOfSpec
, isRealType, isIntegerType, isCaseableType, resolveUserType, isSafeConversion, isPreciseConversion, isImplicitConversionRain , isRealType, isIntegerType, isCaseableType, isScalarType, resolveUserType, isSafeConversion, isPreciseConversion, isImplicitConversionRain
, returnTypesOfFunction , returnTypesOfFunction
, BytesInResult(..), bytesInType, countReplicator, countStructured, computeStructured , BytesInResult(..), bytesInType, countReplicator, countStructured, computeStructured
@ -474,7 +474,7 @@ isIntegerType t
A.Int64 -> True A.Int64 -> True
_ -> False _ -> False
-- Real types. -- | Scalar real types.
isRealType :: A.Type -> Bool isRealType :: A.Type -> Bool
isRealType t isRealType t
= case t of = case t of
@ -482,10 +482,15 @@ isRealType t
A.Real64 -> True A.Real64 -> True
_ -> False _ -> False
-- Types that are permitted as CASE selectors. -- | Types that are permitted as 'Case' selectors.
isCaseableType :: A.Type -> Bool isCaseableType :: A.Type -> Bool
isCaseableType A.Bool = True isCaseableType A.Bool = True
isCaseableType t = isIntegerType t isCaseableType t = isIntegerType t
-- | All scalar types.
isScalarType :: A.Type -> Bool
isScalarType A.Bool = True
isScalarType t = isIntegerType t || isRealType t
--}}} --}}}
--{{{ sizes of types --{{{ sizes of types