Browse Source

Explain String in terms of [Char]

Julian Ospald 4 years ago
parent
commit
22aae2a262
No account linked to committer's email address
1 changed files with 12 additions and 0 deletions
  1. 12
    0
      VL1.tex

+ 12
- 0
VL1.tex View File

@@ -380,6 +380,18 @@ infiniteList = [1..]
380 380
 \end{lstlisting}
381 381
 \end{frame}
382 382
 
383
+\begin{frame}[fragile]
384
+\frametitle{Lists (ctn.)}
385
+A String in haskell is just a list of Chars!
386
+\setHaskellCodeStyle
387
+\begin{lstlisting}
388
+> ['a', 'b', 'c']
389
+> 'a' : []
390
+> head "abc"
391
+> 'a' ++ 'c'
392
+\end{lstlisting}
393
+\end{frame}
394
+
383 395
 \begin{frame}[fragile]
384 396
 \frametitle{Lists (ctn.)}
385 397
 Again, we can do pattern matching on lists.