mirror of
https://github.com/MartinThoma/LaTeX-examples.git
synced 2025-04-19 11:38:05 +02:00
Beispiele für Listenoperationen in Haskell hinzugefügt
This commit is contained in:
parent
7e99fea83a
commit
dbf66188b6
4 changed files with 19 additions and 3 deletions
|
@ -63,6 +63,9 @@ hat einen Speicherverbrauch von $\mathcal{O}(n)$. Durch einen
|
|||
\subsection{Listen}
|
||||
\todo[inline]{Cons-Operator, Unendliche Listen}
|
||||
|
||||
\subsubsection{Beispiel in der interaktiven Konsole}
|
||||
\inputminted[numbersep=5pt, tabsize=4]{haskell}{scripts/haskell/listenoperationen.sh}
|
||||
|
||||
\section{Beispiele}
|
||||
\subsection{Hello World}
|
||||
Speichere folgenden Quelltext als \texttt{hello-world.hs}:
|
||||
|
|
Binary file not shown.
|
@ -63,9 +63,9 @@
|
|||
\newcommand{\helv}{%
|
||||
\fontfamily{phv}\fontseries{b}\fontsize{9}{11}\selectfont}
|
||||
\fancyhf{}
|
||||
\fancyhead[LE,RO]{\helv \thepage}
|
||||
\fancyhead[LO]{\helv \rightmark}
|
||||
\fancyhead[RE]{\helv \leftmark}
|
||||
\fancyhead[LO,RE]{\helv \thepage}
|
||||
\fancyhead[LE]{\helv \rightmark}
|
||||
\fancyhead[RO]{\helv \leftmark}
|
||||
\fancypagestyle{plain}{%
|
||||
\fancyhead{}
|
||||
\renewcommand{\headrulewidth}{0pt}
|
||||
|
|
|
@ -0,0 +1,13 @@
|
|||
Prelude> let mylist = [1,2,3,4,5,6]
|
||||
Prelude> head mylist
|
||||
1
|
||||
Prelude> tail mylist
|
||||
[2,3,4,5,6]
|
||||
Prelude> take 3 mylist
|
||||
[1,2,3]
|
||||
Prelude> drop 2 mylist
|
||||
[3,4,5,6]
|
||||
Prelude> mylist
|
||||
[1,2,3,4,5,6]
|
||||
Prelude> mylist ++ sndList
|
||||
[1,2,3,4,5,6,9,8,7]
|
Loading…
Add table
Add a link
Reference in a new issue