]> hydra-www.ietfng.org Git - dyna2/commitdiff
Fix overlooked fallout from conversion to Insts
authorNathaniel Wesley Filardo <nwf@cs.jhu.edu>
Fri, 17 May 2013 20:46:48 +0000 (16:46 -0400)
committerNathaniel Wesley Filardo <nwf@cs.jhu.edu>
Fri, 17 May 2013 20:48:19 +0000 (16:48 -0400)
This has a side-effect of fixing haddock builds. :)

src/Dyna/Analysis/RuleMode.hs

index 3d4460eafc776fb2d3ee9f7a614b903127cd3baa..72d5e08e5f94a3a42426fac132fb20a4c390379d 100644 (file)
@@ -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