In a shallow \gls{EDSL} all language constructs are expressed as functions in
the host language. An evaluator view for the example language then can be
implemented as the code shown in Listing~\ref{lst:exshallow}. Note that much of
the internals of the language can be hidden using monads.

\begin{lstlisting}[language=Clean,label={lst:exshallow},%
	caption={A minimal shallow \gls{EDSL}}]
:: Env   = ...            // Some environment
:: DSL a = DSL (Env -> a)

Lit :: a -> DSL a
Lit x = \e -> x

Var :: String -> DSL Int
Var i = \e -> retrEnv e i

Plus :: (DSL Int) (DSL Int) -> DSL Int
Plus x y = \e -> x e + y e

...

Eq :: (DSL a) (DSL a) -> DSL Bool | == a
Eq x y = \e -> x e + y e
\end{lstlisting}

The advantage of shallowly embedding a language in a host language is its
extendability. It is very easy to add functionality and compile time checks
of the host language guarantee whether or not the functionality is available
when used. Moreover, the language is type safe as it is directly typed in the
host language.

The downside of this method is extending the language with views. It is nearly
impossible to add views to a shallowly embedded language. The only way of
achieving this is by decorating the datatype for the \gls{EDSL} with all the
information for all the views. This will mean that every component will have to
implement all views rendering it slow for multiple views and complex to
implement.
