From 22aae2a2629815af808855a3c5805d4b43004411 Mon Sep 17 00:00:00 2001 From: Julian Ospald Date: Wed, 15 Apr 2015 17:46:47 +0200 Subject: [PATCH] Explain String in terms of [Char] --- VL1.tex | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/VL1.tex b/VL1.tex index f21f367..60afc22 100644 --- a/VL1.tex +++ b/VL1.tex @@ -380,6 +380,18 @@ infiniteList = [1..] \end{lstlisting} \end{frame} +\begin{frame}[fragile] +\frametitle{Lists (ctn.)} +A String in haskell is just a list of Chars! +\setHaskellCodeStyle +\begin{lstlisting} +> ['a', 'b', 'c'] +> 'a' : [] +> head "abc" +> 'a' ++ 'c' +\end{lstlisting} +\end{frame} + \begin{frame}[fragile] \frametitle{Lists (ctn.)} Again, we can do pattern matching on lists.