Permalink
Browse files

Break the module cycles in the evaluator in a different way.

Single shot compilation with GHC has issues with the .hs-boot file for ValuePrettyPrinter.
  • Loading branch information...
1 parent eadcc89 commit 1cb9977bb426a90593f163cb69337d39e774679c @tomgr committed Aug 19, 2012
View
3 src/CSPM/Evaluator/Dot.hs
@@ -6,10 +6,9 @@ module CSPM.Evaluator.Dot (
) where
import CSPM.DataStructures.Names
-import CSPM.Evaluator.Exceptions
+import {-# SOURCE #-} CSPM.Evaluator.Exceptions
import CSPM.Evaluator.Monad
import CSPM.Evaluator.Values
-import {-# SOURCE #-} CSPM.Evaluator.ValuePrettyPrinter()
import CSPM.Evaluator.ValueSet hiding (cartesianProduct)
import qualified CSPM.Evaluator.ValueSet as S
import Data.List (groupBy)
View
4 src/CSPM/Evaluator/Exceptions.hs
@@ -6,9 +6,9 @@ import Prelude
import CSPM.DataStructures.Names
import CSPM.DataStructures.Syntax
import CSPM.PrettyPrinter
-import {-# SOURCE #-} CSPM.Evaluator.ValuePrettyPrinter ()
+import CSPM.Evaluator.ValuePrettyPrinter ()
import CSPM.Evaluator.Values
-import {-# SOURCE #-} CSPM.Evaluator.ValueSet
+import CSPM.Evaluator.ValueSet hiding (empty)
import Util.Annotated
import Util.Exception
import Util.PrettyPrint
View
28 src/CSPM/Evaluator/Exceptions.hs-boot
@@ -0,0 +1,28 @@
+module CSPM.Evaluator.Exceptions where
+
+import Prelude
+
+import CSPM.DataStructures.Names
+import CSPM.DataStructures.Syntax
+import {-# SOURCE #-} CSPM.Evaluator.Values
+import {-# SOURCE #-} CSPM.Evaluator.ValueSet
+import Util.Annotated
+import Util.Exception
+
+patternMatchFailureMessage :: SrcSpan -> TCPat -> Value -> ErrorMessage
+headEmptyListMessage :: SrcSpan -> Maybe ScopeIdentifier -> ErrorMessage
+tailEmptyListMessage :: SrcSpan -> Maybe ScopeIdentifier -> ErrorMessage
+funBindPatternMatchFailureMessage :: SrcSpan -> Name -> [[Value]] -> ErrorMessage
+replicatedInternalChoiceOverEmptySetMessage :: Exp Name -> SrcSpan ->
+ Maybe ScopeIdentifier -> ErrorMessage
+replicatedInternalChoiceOverEmptySetMessage' :: Pat Name -> SrcSpan ->
+ Maybe ScopeIdentifier -> ErrorMessage
+typeCheckerFailureMessage :: String -> ErrorMessage
+cannotConvertIntegersToListMessage :: ErrorMessage
+cannotConvertProcessesToListMessage :: ErrorMessage
+cannotCheckSetMembershipError :: Value -> ValueSet -> ErrorMessage
+cardOfInfiniteSetMessage :: ValueSet -> ErrorMessage
+cannotDifferenceSetsMessage :: ValueSet -> ValueSet -> ErrorMessage
+dotIsNotValidMessage :: Value -> Int -> Value -> ValueSet -> SrcSpan ->
+ Maybe ScopeIdentifier -> ErrorMessage
+setNotRectangularErrorMessage :: ValueSet -> ValueSet -> ErrorMessage
View
39 src/CSPM/Evaluator/ValuePrettyPrinter.hs-boot
@@ -1,39 +0,0 @@
-{-# LANGUAGE FlexibleContexts, FlexibleInstances, IncoherentInstances,
- MultiParamTypeClasses, TypeSynonymInstances, UndecidableInstances #-}
-module CSPM.Evaluator.ValuePrettyPrinter () where
-
-import Control.Applicative
-import CSPM.DataStructures.Syntax
-import CSPM.Evaluator.Monad
-import CSPM.Evaluator.ProcessValues
-import {-# SOURCE #-} CSPM.Evaluator.Values
-import {-# SOURCE #-} CSPM.Evaluator.ValueSet
-import qualified Data.Foldable as F
-import qualified Data.Sequence as S
-import Util.PrettyPrint
-import qualified Util.MonadicPrettyPrint as M
-
-instance PrettyPrintable Event
-instance PrettyPrintable (S.Seq Event)
-instance PrettyPrintable ProcName
-instance PrettyPrintable Value
-instance PrettyPrintable ValueSet
-instance PrettyPrintable UnCompiledProc
-instance PrettyPrintable ProcOperator
-instance PrettyPrintable ScopeIdentifier
-instance (Applicative m, Monad m, M.MonadicPrettyPrintable m Value) =>
- M.MonadicPrettyPrintable m Event
-instance (Applicative m, Monad m) => M.MonadicPrettyPrintable m ProcOperator
-instance (F.Foldable f) => M.MonadicPrettyPrintable EvaluationMonad (f Event)
-instance (Applicative m, Monad m, M.MonadicPrettyPrintable m Value) =>
- M.MonadicPrettyPrintable m ProcName
-instance (Applicative m, F.Foldable seq, Functor seq, Monad m,
- M.MonadicPrettyPrintable m pn, M.MonadicPrettyPrintable m ev,
- M.MonadicPrettyPrintable m evs) =>
- M.MonadicPrettyPrintable m (Proc seq CSPOperator pn ev evs (seq (ev,ev)))
-instance (Applicative m, Monad m,
- M.MonadicPrettyPrintable m TCExp,
- M.MonadicPrettyPrintable m UnCompiledProc,
- M.MonadicPrettyPrintable m ValueSet) =>
- M.MonadicPrettyPrintable m Value where
-instance M.MonadicPrettyPrintable EvaluationMonad ValueSet
View
2 src/CSPM/Evaluator/ValueSet.hs
@@ -31,7 +31,7 @@ import qualified Data.Set as S
import qualified Data.Sequence as Sq
import qualified Data.Traversable as T
-import CSPM.Evaluator.Exceptions
+import {-# SOURCE #-} CSPM.Evaluator.Exceptions
import CSPM.Evaluator.Values
import qualified CSPM.Evaluator.ProcessValues as CE
import Util.Exception
View
7 src/CSPM/Evaluator/Values.hs
@@ -15,9 +15,7 @@ import CSPM.DataStructures.Syntax
import CSPM.DataStructures.Types
import CSPM.Evaluator.Monad
import CSPM.Evaluator.ProcessValues
-import {-# SOURCE #-} CSPM.Evaluator.ValuePrettyPrinter()
import {-# SOURCE #-} qualified CSPM.Evaluator.ValueSet as S
-import CSPM.PrettyPrinter
import Data.Array
import qualified Data.Foldable as F
import Data.Hashable
@@ -215,8 +213,7 @@ compareValues (VDot vs1) (VDot vs2) =
if vs1 == vs2 then Just EQ else Nothing
-- Every other possibility is invalid
-compareValues v1 v2 = panic $ "Cannot compare two values "++
- show (prettyPrint v1)++ " "++show (prettyPrint v2)
+compareValues v1 v2 = panic $ "Cannot compare two values"
instance Ord Value where
-- This implementation is used for various internal measures, but not
@@ -236,7 +233,7 @@ instance Ord Value where
compare v1 v2 = panic $
-- Must be as a result of a mixed set of values, which cannot happen
-- as a result of type checking.
- "Internal sets - cannot order "++show (prettyPrint v1)++show (prettyPrint v2)
+ "Internal sets - cannot order "
procName :: ScopeIdentifier -> ProcName
procName = ProcName

0 comments on commit 1cb9977

Please sign in to comment.