From 713b5c3e5cda821aa17bbb0fb7934feb74211f71 Mon Sep 17 00:00:00 2001 From: Neil Brown Date: Wed, 19 Mar 2008 17:52:01 +0000 Subject: [PATCH] Added a subExprs helper function to match the rest --- common/Types.hs | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/common/Types.hs b/common/Types.hs index d31162d..01519e8 100644 --- a/common/Types.hs +++ b/common/Types.hs @@ -24,7 +24,8 @@ module Types , returnTypesOfFunction , BytesInResult(..), bytesInType, countReplicator, countStructured, computeStructured - , makeAbbrevAM, makeConstant, makeDimension, addOne, addExprs, mulExprs, divExprs + , makeAbbrevAM, makeConstant, makeDimension, addOne, addExprs, subExprs, + mulExprs, divExprs , addDimensions, removeFixedDimensions, trivialSubscriptType, subscriptType, unsubscriptType , recordFields, protocolItems @@ -594,6 +595,11 @@ addExprs :: A.Expression -> A.Expression -> A.Expression addExprs a b = A.Dyadic m A.Add a b where m = findMeta a +-- | Add two expressions. +subExprs :: A.Expression -> A.Expression -> A.Expression +subExprs a b = A.Dyadic m A.Subtr a b + where m = findMeta a + -- | Multiply two expressions. mulExprs :: A.Expression -> A.Expression -> A.Expression mulExprs a b = A.Dyadic m A.Mul a b