1 Expressions in the
\gls{mTask
}-
\gls{EDSL
} are divided into two types, namely
2 boolean expressions and arithmetic expressions. The class of arithmetic
3 language constructs also contains the function
\CI{lit
} that lifts a
4 host-language value into the
\gls{EDSL
} domain. All standard arithmetic
5 functions are included in the
\gls{EDSL
} but are omitted in the example for
6 brevity. Moreover, the class restrictions are only shown in the first functions
7 and are omitted in subsequent functions. Both the boolean expression and
8 arithmetic expression classes are shown in Listing~
\ref{lst:arithbool
}.
10 \begin{lstlisting
}[language=Clean,label=
{lst:arithbool
},
11 caption=
{Basic classes for expressions
}]
14 (+.) infixl
6 :: (v t p) (v t q) -> v t Expr | +, zero t & isExpr p & isExpr q
15 (-.) infixl
6 :: (v t p) (v t q) -> v t Expr | -, zero t & ...
17 class boolExpr v where
18 Not :: (v Bool p) -> v Bool Expr | ...
19 (&.) infixr
3 :: (v Bool p) (v Bool q) -> v Bool Expr | ...
21 (==.) infix
4 :: (v a p) (v a q) -> v Bool Expr | ==, toCode a & ...