From ca9476000bf144f6b8c7d275d620d32444f00c76 Mon Sep 17 00:00:00 2001 From: Rob Rix Date: Fri, 23 Mar 2018 20:38:47 -0400 Subject: [PATCH] Move the Recursive constraint into the MonadEvaluatable synonym. --- src/Analysis/Abstract/Dead.hs | 1 + src/Analysis/Abstract/Evaluating.hs | 1 - src/Control/Abstract/Analysis.hs | 3 ++- 3 files changed, 3 insertions(+), 2 deletions(-) diff --git a/src/Analysis/Abstract/Dead.hs b/src/Analysis/Abstract/Dead.hs index 6d62fd23d..1b1a17f57 100644 --- a/src/Analysis/Abstract/Dead.hs +++ b/src/Analysis/Abstract/Dead.hs @@ -44,6 +44,7 @@ instance ( Corecursive term , Member (State (Dead term)) effects , MonadAnalysis term value (m term value effects) , Ord term + , Recursive term ) => MonadAnalysis term value (DeadCode m term value effects) where type RequiredEffects term value (DeadCode m term value effects) = State (Dead term) ': RequiredEffects term value (m term value effects) diff --git a/src/Analysis/Abstract/Evaluating.hs b/src/Analysis/Abstract/Evaluating.hs index 166196f6b..439c17710 100644 --- a/src/Analysis/Abstract/Evaluating.hs +++ b/src/Analysis/Abstract/Evaluating.hs @@ -79,7 +79,6 @@ instance Members (EvaluatingEffects term value) effects => MonadEvaluator term v instance ( Members (EvaluatingEffects term value) effects , MonadValue value (Evaluating term value effects) - , Recursive term ) => MonadAnalysis term value (Evaluating term value effects) where type RequiredEffects term value (Evaluating term value effects) = EvaluatingEffects term value diff --git a/src/Control/Abstract/Analysis.hs b/src/Control/Abstract/Analysis.hs index 4c78ccce8..07a48b1cb 100644 --- a/src/Control/Abstract/Analysis.hs +++ b/src/Control/Abstract/Analysis.hs @@ -38,7 +38,7 @@ import Prologue -- | A 'Monad' in which one can evaluate some specific term type to some specific value type. -- -- This typeclass is left intentionally unconstrained to avoid circular dependencies between it and other typeclasses. -class (MonadEvaluator term value m, Recursive term) => MonadAnalysis term value m where +class MonadEvaluator term value m => MonadAnalysis term value m where -- | The effects necessary to run the analysis. Analyses which are composed on top of (wrap) other analyses should include the inner analyses 'RequiredEffects' in their own list. type family RequiredEffects term value m :: [* -> *] @@ -68,6 +68,7 @@ type MonadEvaluatable term value m = , MonadAnalysis term value m , MonadThrow Prelude.String value m , MonadValue value m + , Recursive term , Show (LocationFor value) )