ivory-opts-0.1.0.3: src/Ivory/Opts/Utils.hs
--------------------------------------------------------------------------------
-- | Utilities.
--------------------------------------------------------------------------------
module Ivory.Opts.Utils
where
import qualified Ivory.Language.Syntax.AST as I
import qualified Ivory.Language.Syntax.Type as I
--------------------------------------------------------------------------------
-- | Type of the expression's arguments.
expOpType :: I.Type -> I.ExpOp -> I.Type
expOpType t0 op = case op of
I.ExpEq t1 -> t1
I.ExpNeq t1 -> t1
I.ExpGt _ t1 -> t1
I.ExpLt _ t1 -> t1
I.ExpIsNan t1 -> t1
I.ExpIsInf t1 -> t1
_ -> t0
--------------------------------------------------------------------------------