never executed always true always false
    1 {- |
    2 Module      : NITTA.Synthesis.Steps
    3 Description : Synthesis tree representation
    4 Copyright   : (c) Aleksandr Penskoi, 2022
    5 License     : BSD3
    6 Maintainer  : aleksandr.penskoi@gmail.com
    7 Stability   : experimental
    8 -}
    9 module NITTA.Synthesis.Steps (
   10     module NITTA.Synthesis.Steps.Allocation,
   11     module NITTA.Synthesis.Steps.Bind,
   12     module NITTA.Synthesis.Steps.Dataflow,
   13     module NITTA.Synthesis.Steps.BreakLoop,
   14     module NITTA.Synthesis.Steps.OptimizeAccum,
   15     module NITTA.Synthesis.Steps.ResolveDeadlock,
   16     module NITTA.Synthesis.Steps.ConstantFolding,
   17     isRefactor,
   18 ) where
   19 
   20 import Data.Maybe (isJust)
   21 import Data.Typeable (cast)
   22 import NITTA.Synthesis.Steps.Allocation
   23 import NITTA.Synthesis.Steps.Bind
   24 import NITTA.Synthesis.Steps.BreakLoop
   25 import NITTA.Synthesis.Steps.ConstantFolding
   26 import NITTA.Synthesis.Steps.Dataflow
   27 import NITTA.Synthesis.Steps.OptimizeAccum
   28 import NITTA.Synthesis.Steps.ResolveDeadlock
   29 import NITTA.Synthesis.Types (SynthesisDecision (SynthesisDecision, metrics))
   30 
   31 isRefactor SynthesisDecision{metrics}
   32     | isJust (cast metrics :: Maybe BreakLoopMetrics) = True
   33     | isJust (cast metrics :: Maybe OptimizeAccumMetrics) = True
   34     | isJust (cast metrics :: Maybe ResolveDeadlockMetrics) = True
   35     | isJust (cast metrics :: Maybe ConstantFoldingMetrics) = True
   36 isRefactor _ = False