-
Notifications
You must be signed in to change notification settings - Fork 0
/
more-examples.tex
56 lines (50 loc) · 1.11 KB
/
more-examples.tex
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
\begin{frame}[fragile]
\frametitle{Here are some more examples}
\begin{block}{One inhabitant}
\begin{lstlisting}[style=haskell]
-- Haskell
(b -> c) -> (a -> b) -> a -> c
\end{lstlisting}
\begin{lstlisting}[style=java]
// Java
<A, B, C>
Function<A, C> c(Function<B, C> f, Function<A, B> g)
\end{lstlisting}
\end{block}
\end{frame}
\begin{frame}[fragile]
\frametitle{Here are some more examples}
\begin{block}{Two inhabitants}
\begin{lstlisting}[style=haskell]
-- Haskell
a -> a -> a
\end{lstlisting}
\begin{lstlisting}[style=java]
// Java
<A>
A c(A a1, A a2)
\end{lstlisting}
\end{block}
\begin{center}
Prove using the Yoneda lemma \lstinline{= boolean = 2}
What tests can we write?
\end{center}
\end{frame}
\begin{frame}[fragile]
\frametitle{Here are some more examples}
\begin{block}{One inhabitant}
\begin{lstlisting}[style=haskell]
-- Haskell
Functor f => a -> f b -> f a
\end{lstlisting}
\end{block}
\end{frame}
\begin{frame}[fragile]
\frametitle{Here are some more examples}
\begin{block}{Infinite inhabitants}
\begin{lstlisting}[style=haskell]
-- Haskell
Applicative f => a -> f b -> f a
\end{lstlisting}
\end{block}
\end{frame}