From: Nathaniel Wesley Filardo Date: Fri, 17 May 2013 20:46:48 +0000 (-0400) Subject: Fix overlooked fallout from conversion to Insts X-Git-Url: https://hydra-www.ietfng.org/gitweb/?a=commitdiff_plain;h=83fa2f017ec973be3cfe36e5850dfd31abaa2e87;p=dyna2 Fix overlooked fallout from conversion to Insts This has a side-effect of fixing haddock builds. :) --- diff --git a/src/Dyna/Analysis/RuleMode.hs b/src/Dyna/Analysis/RuleMode.hs index 3d4460e..72d5e08 100644 --- a/src/Dyna/Analysis/RuleMode.hs +++ b/src/Dyna/Analysis/RuleMode.hs @@ -33,6 +33,7 @@ module Dyna.Analysis.RuleMode {- ( adornedQueries ) -} where +import Control.Lens ((^.)) import Control.Monad import Control.Monad.Error.Class import Control.Monad.Trans.Either @@ -286,19 +287,22 @@ simpleCost (PP { pp_score = osc, pp_plan = pfx }) act = OPPeel _ _ _ -> 0 OPWrap _ _ _ -> 1 -- Upweight building due to side-effects -- in the intern table - OPIter _ _ _ d _ -> case d of + OPIter o is _ d _ -> case d of DetErroneous -> 0 DetFailure -> 0 Det -> 0 DetSemi -> 1 - DetNon -> 2 {- ** (fromIntegral $ length $ + DetNon -> 2 ** (fromIntegral $ length $ filter isFree (o:is)) - - 1 -} + - 1 DetMulti -> 2 OPIndr _ _ -> 100 loops = fromIntegral . length . filter isLoop + isFree :: ModedVar -> Bool + isFree v = iIsFree $ nExpose (v^.mv_mi) + isLoop :: DOpAMine fbs -> Bool isLoop = (== DetNon) . detOfDop