subsection
[msc-thesis1617.git] / edsl.class.tex
index aafd355..8da1d27 100644 (file)
@@ -20,7 +20,7 @@ choose to implement only parts of the collection of classes.
 In contrast to deep embedding, it is very well possible to have multiple views
 applied on the same expression. This is also shown in the following listing.
 
-\begin{lstlisting}[label={lst:exclassshallow},%
+\begin{lstlisting}[language=Clean,label={lst:exclassshallow},%
        caption={A minimal class based shallow \gls{EDSL}}]
 :: Env   = ...            // Some environment
 :: Evaluator a = Evaluator (Env -> a)
@@ -36,12 +36,12 @@ class boolArith where
        eq  :: (v t)    (v t)    -> (v Bool) | == t
 
 instance intArith Evaluator where
-       lit x = \e->x
-       add x y = ...
+       lit x   = Evaluator \e->x
+       add x y = Evaluator ...
 
 instance intArith PrettyPrinter where
-       lit x = toString x
-       add x y = x +++ "+" +++ y
+       lit x   = PP $ toString x
+       add x y = PP $ x +++ "+" +++ y
        ...
 
 ...