Browse Source

Explain String in terms of [Char]

stripped-german
Julian Ospald 5 years ago
parent
commit
22aae2a262
No known key found for this signature in database GPG Key ID: 220CD1C5BDEED020
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..]
\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.


Loading…
Cancel
Save