From ee495d5974e55eacc04986df09b732a258f63e6b Mon Sep 17 00:00:00 2001 From: Matthijs Kooijman Date: Thu, 6 Aug 2009 15:56:23 +0200 Subject: [PATCH] Add changeif normalization helper function. --- "c\316\273ash/CLasH/Normalize/NormalizeTools.hs" | 6 ++++++ 1 file changed, 6 insertions(+) diff --git "a/c\316\273ash/CLasH/Normalize/NormalizeTools.hs" "b/c\316\273ash/CLasH/Normalize/NormalizeTools.hs" index b26cb74..76fc749 100644 --- "a/c\316\273ash/CLasH/Normalize/NormalizeTools.hs" +++ "b/c\316\273ash/CLasH/Normalize/NormalizeTools.hs" @@ -158,6 +158,12 @@ change val = do setChanged return val +-- Returns the given value and sets the changed flag if the bool given is +-- True. Note that this will not unset the changed flag if the bool is False. +changeif :: Bool -> a -> TransformMonad a +changeif True val = change val +changeif False val = return val + -- Replace each of the binders given with the coresponding expressions in the -- given expression. substitute :: [(CoreBndr, CoreExpr)] -> CoreExpr -> CoreExpr -- 2.30.2