From 7f90087ab9c77ac2e2a57d53b8a985feb45d43f2 Mon Sep 17 00:00:00 2001 From: bjorn Date: Fri, 30 May 2008 13:56:50 +0000 Subject: Added setOptimization function to GF.Infra.Options. I will need to do similar things for other options. --- src-3.0/GF/Compile/BackOpt.hs | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'src-3.0/GF/Compile/BackOpt.hs') diff --git a/src-3.0/GF/Compile/BackOpt.hs b/src-3.0/GF/Compile/BackOpt.hs index 0043d02d8..2814448b4 100644 --- a/src-3.0/GF/Compile/BackOpt.hs +++ b/src-3.0/GF/Compile/BackOpt.hs @@ -27,7 +27,10 @@ import Data.List import qualified GF.Infra.Modules as M import qualified Data.ByteString.Char8 as BS -type OptSpec = [Optimization] +import Data.Set (Set) +import qualified Data.Set as Set + +type OptSpec = Set Optimization shareModule :: OptSpec -> (Ident, SourceModInfo) -> (Ident, SourceModInfo) shareModule opt (i,m) = case m of @@ -42,8 +45,8 @@ shareInfo _ i = i -- the function putting together optimizations shareOptim :: OptSpec -> Ident -> Term -> Term -shareOptim opt c = (if OptValues `elem` opt then values else id) - . (if OptParametrize `elem` opt then factor c 0 else id) +shareOptim opt c = (if OptValues `Set.member` opt then values else id) + . (if OptParametrize `Set.member` opt then factor c 0 else id) -- do even more: factor parametric branches -- cgit v1.2.3