Explain String in terms of [Char]
This commit is contained in:
parent
162b8e109b
commit
22aae2a262
12
VL1.tex
12
VL1.tex
@ -380,6 +380,18 @@ infiniteList = [1..]
|
|||||||
\end{lstlisting}
|
\end{lstlisting}
|
||||||
\end{frame}
|
\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]
|
\begin{frame}[fragile]
|
||||||
\frametitle{Lists (ctn.)}
|
\frametitle{Lists (ctn.)}
|
||||||
Again, we can do pattern matching on lists.
|
Again, we can do pattern matching on lists.
|
||||||
|
Loading…
Reference in New Issue
Block a user