\begin{CleanCode}
:: M a = ...
unit :: a -> M a
-((#$\star$#)) :: (M a) (a -> M b) -> M b
+((#$\star$#)) infixl 1 :: (M a) (a -> M b) -> M b
\end{CleanCode}
\end{block}
\pause%
\begin{block}{Evaluator (Identity monad)}
\begin{CleanCode}
:: M a :== a
-unit :: a -> I a
+unit :: a -> a
unit a = a
-((#$\star$#)) :: (M a) (a -> M b) -> M b
+((#$\star$#)) infixl 1 :: (M a) (a -> M b) -> M b
((#$\star$#)) a k = k a
\end{CleanCode}
\end{block}
unit :: a -> M a
unit a = Return a
-((#$\star$#)) :: (M a) (a -> M b) -> M b
+((#$\star$#)) infixl 1 :: (M a) (a -> M b) -> M b
((#$\star$#)) m k = case m of
Raise e = Raise e
Return a = k a
unit :: a -> M a
unit a = \x.(a, x)
-((#$\star$#)) :: (M a) (a -> M b) -> M b
+((#$\star$#)) infixl 1 :: (M a) (a -> M b) -> M b
((#$\star$#)) m k = \x.let (a, y) = m x in
let (b, z) = k a y in
(b, z)
unit :: a -> M a
unit a = \x.[(a, x)]
-((#$\star$#)) :: (M a) (a -> M b) -> M b
+((#$\star$#)) infixl 1 :: (M a) (a -> M b) -> M b
((#$\star$#)) m k = \x.[(b, z) \\ (a, y) <- m x, (b, z) <- k a y]
\end{CleanCode}
\end{frame}
zero :: M a
zero = \x.[]
-((#$\oplus$#)) :: (M a) (M a) -> M a
+((#$\oplus$#)) infixl 4 :: (M a) (M a) -> M a
((#$\oplus$#)) m n = \x.m x ++ n x
-((#$\triangleright$#)) :: (M a) (a -> Bool) -> M a
+((#$\triangleright$#)) infixl 4 :: (M a) (a -> Bool) -> M a
((#$\triangleright$#)) m p = m (#$\star$#) \a.if (p a) (unit a) zero
item :: M Char
-item [] = []
-item [a:x] = [(a, x)]
+item = \x.case x of
+ [] = []
+ [a:x] = [(a, x)]
\end{CleanCode}
\end{frame}
\end{CleanCode}
\pause
\begin{CleanCode}
-((#$\oslash$#)) :: (M a) (M a) -> M a
+((#$\oslash$#)) infixl 4 :: (M a) (M a) -> M a
((#$\oslash$#)) m n = \x.if (m x <> []) (m x) (n x)
\end{CleanCode}
\end{frame}