Explain String in terms of [Char]

This commit is contained in:
Julian Ospald 2015-04-15 17:46:47 +02:00
父節點 162b8e109b
當前提交 22aae2a262
沒有發現已知的金鑰在資料庫的簽署中
GPG 金鑰 ID: 220CD1C5BDEED020
共有 1 個檔案被更改,包括 12 行新增0 行删除

12
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.