sep of concerns
[clean-tests.git] / expr / exist / while.dcl
index 7431e3f..a2535f3 100644 (file)
@@ -9,20 +9,20 @@ definition module while
        | (:.) infixr 0 WhileExpr WhileExpr
        | While WhileBool Do WhileExpr
        | Skip
-       | E.e: WExpr e & eval e
+       | E.e: WExpr e & eval e & print e
 
 :: WhileBool
        = Bool Bool
        | (==.) infix 4 WhileInt WhileInt
        | (&.) infix 3 WhileBool WhileBool
        | Not WhileBool
-       | E.e: WBool e & evalb e
+       | E.e: WBool e & evalb e & print e
 
 :: WhileInt
        = Int Int
        | Var String
        | (+.) infixl 6 WhileInt WhileInt
-       | E.e: WInt e & evali e
+       | E.e: WInt e & evali e & print e
 
 class gamma g
 where
@@ -40,3 +40,9 @@ class evalb m :: m -> (g -> Bool) | gamma g
 instance eval WhileExpr
 instance evali WhileInt
 instance evalb WhileBool
+
+class print m :: m -> String
+
+instance print WhileExpr
+instance print WhileInt
+instance print WhileBool