1
1
mirror of https://github.com/sdiehl/wiwinwlh.git synced 2024-10-05 16:08:22 +03:00

Write more

This commit is contained in:
sdiehl 2020-01-25 12:46:04 +00:00
parent f8d01d5799
commit de3ed731cb
5 changed files with 1214 additions and 135 deletions

96
img/Haskell-Logo.ps Normal file
View File

@ -0,0 +1,96 @@
%!PS-Adobe-3.0
%%Creator: cairo 1.10.2 (http://cairographics.org)
%%CreationDate: Wed Jan 14 11:07:43 2015
%%Pages: 1
%%BoundingBox: 0 0 490 349
%%DocumentData: Clean7Bit
%%LanguageLevel: 2
%%DocumentMedia: 173x123mm 490 348 0 () ()
%%EndComments
%%BeginProlog
/languagelevel where
{ pop languagelevel } { 1 } ifelse
2 lt { /Helvetica findfont 12 scalefont setfont 50 500 moveto
(This print job requires a PostScript Language Level 2 printer.) show
showpage quit } if
/q { gsave } bind def
/Q { grestore } bind def
/cm { 6 array astore concat } bind def
/w { setlinewidth } bind def
/J { setlinecap } bind def
/j { setlinejoin } bind def
/M { setmiterlimit } bind def
/d { setdash } bind def
/m { moveto } bind def
/l { lineto } bind def
/c { curveto } bind def
/h { closepath } bind def
/re { exch dup neg 3 1 roll 5 3 roll moveto 0 rlineto
0 exch rlineto 0 rlineto closepath } bind def
/S { stroke } bind def
/f { fill } bind def
/f* { eofill } bind def
/n { newpath } bind def
/W { clip } bind def
/W* { eoclip } bind def
/BT { } bind def
/ET { } bind def
/pdfmark where { pop globaldict /?pdfmark /exec load put }
{ globaldict begin /?pdfmark /pop load def /pdfmark
/cleartomark load def end } ifelse
/BDC { mark 3 1 roll /BDC pdfmark } bind def
/EMC { mark /EMC pdfmark } bind def
/cairo_store_point { /cairo_point_y exch def /cairo_point_x exch def } def
/Tj { show currentpoint cairo_store_point } bind def
/TJ {
{
dup
type /stringtype eq
{ show } { -0.001 mul 0 cairo_font_matrix dtransform rmoveto } ifelse
} forall
currentpoint cairo_store_point
} bind def
/cairo_selectfont { cairo_font_matrix aload pop pop pop 0 0 6 array astore
cairo_font exch selectfont cairo_point_x cairo_point_y moveto } bind def
/Tf { pop /cairo_font exch def /cairo_font_matrix where
{ pop cairo_selectfont } if } bind def
/Td { matrix translate cairo_font_matrix matrix concatmatrix dup
/cairo_font_matrix exch def dup 4 get exch 5 get cairo_store_point
/cairo_font where { pop cairo_selectfont } if } bind def
/Tm { 2 copy 8 2 roll 6 array astore /cairo_font_matrix exch def
cairo_store_point /cairo_font where { pop cairo_selectfont } if } bind def
/g { setgray } bind def
/rg { setrgbcolor } bind def
/d1 { setcachedevice } bind def
%%EndProlog
%%Page: 1 1
%%BeginPageSetup
%%PageMedia: 173x123mm
%%PageBoundingBox: 0 0 490 349
%%EndPageSetup
q 0 0 490 349 rectclip q
1 g
8 w
0 J
1 j
[] 0.0 d
4 M q 1 0 0 -1 0 348.156311 cm
4.016 344.156 m 117.402 174.078 l 4.016 4 l 89.055 4 l 202.441 174.078
l 89.055 344.156 l h
4.016 344.156 m S Q
q 1 0 0 -1 0 348.156311 cm
117.402 344.156 m 230.789 174.078 l 117.402 4 l 202.441 4 l 429.211
344.156 l 344.172 344.156 l 273.309 237.859 l 202.441 344.156 l h
117.402 344.156 m S Q
q 1 0 0 -1 0 348.156311 cm
391.418 244.945 m 353.625 188.254 l 485.906 188.25 l 485.906 244.945 l
h
391.418 244.945 m S Q
q 1 0 0 -1 0 348.156311 cm
334.727 159.906 m 296.93 103.215 l 485.906 103.211 l 485.906 159.906 l
h
334.727 159.906 m S Q
Q Q
showpage
%%Trailer
%%EOF

1029
resources/dtrt.sty Normal file

File diff suppressed because it is too large Load Diff

View File

@ -1,5 +1,6 @@
\documentclass[$if(fontsize)$$fontsize$,$endif$$if(lang)$$babel-lang$,$endif$$if(papersize)$$papersize$paper,$endif$$for(classoption)$$classoption$$sep$,$endfor$]{$documentclass$}
\usepackage{geometry}
\usepackage{resources/dtrt}
\geometry{
a4paper,
total={21.59cm,27.94cm},
@ -10,134 +11,62 @@
% For pdf
left=1.5cm,
right=1.5cm,
% For printing
% For print
%marginparwidth=4cm,
%marginparsep=0.8cm
}
$if(fontfamily)$
\usepackage[$for(fontfamilyoptions)$$fontfamilyoptions$$sep$,$endfor$]{$fontfamily$}
$else$
\usepackage{lmodern}
$endif$
\usepackage{xcolor}
\usepackage{hyperref}
\hypersetup{%
colorlinks=false,% hyperlinks will be black
linkbordercolor=red,% hyperlink borders will be red
pdfborderstyle={/S/U/W 1}% border style will be underline of width 1pt
colorlinks=false, % hyperlinks will be black
linkbordercolor=red, % hyperlink borders will be red
pdfborderstyle={/S/U/W 1} % border style will be underline of width 1pt
}
$if(linestretch)$
\usepackage{setspace}
\setstretch{$linestretch$}
$endif$
\usepackage{amssymb,amsmath}
\usepackage{ifxetex,ifluatex}
\ifnum 0\ifxetex 1\fi\ifluatex 1\fi=0 % if pdftex
\usepackage[$if(fontenc)$$fontenc$$else$T1$endif$]{fontenc}
\usepackage[utf8]{inputenc}
$if(euro)$
\usepackage{eurosym}
$endif$
\else % if luatex or xelatex
\ifxetex
\usepackage{mathspec}
\else
\usepackage{fontspec}
\fi
\defaultfontfeatures{Ligatures=TeX,Scale=MatchLowercase}
\setmonofont{DejaVu Sans Mono}
$if(euro)$
\newcommand{\euro}{€}
$endif$
$if(mainfont)$
\setmainfont[$for(mainfontoptions)$$mainfontoptions$$sep$,$endfor$]{$mainfont$}
$endif$
$if(sansfont)$
\setsansfont[$for(sansfontoptions)$$sansfontoptions$$sep$,$endfor$]{$sansfont$}
$endif$
$if(monofont)$
\setmonofont[Mapping=tex-ansi$if(monofontoptions)$,$for(monofontoptions)$$monofontoptions$$sep$,$endfor$$endif$]{$monofont$}
$endif$
$if(mathfont)$
\setmathfont(Digits,Latin,Greek)[$for(mathfontoptions)$$mathfontoptions$$sep$,$endfor$]{$mathfont$}
$endif$
$if(CJKmainfont)$
\usepackage{xeCJK}
\setCJKmainfont[$for(CJKoptions)$$CJKoptions$$sep$,$endfor$]{$CJKmainfont$}
$endif$
\fi
% use upquote if available, for straight quotes in verbatim environments
\IfFileExists{upquote.sty}{\usepackage{upquote}}{}
% use microtype if available
\IfFileExists{microtype.sty}{%
\usepackage{microtype}
\UseMicrotypeSet[protrusion]{basicmath} % disable protrusion for tt fonts
}{}
$if(geometry)$
\usepackage[$for(geometry)$$geometry$$sep$,$endfor$]{geometry}
$endif$
\usepackage{hyperref}
$if(colorlinks)$
\PassOptionsToPackage{usenames,dvipsnames}{color} % color is loaded by hyperref
$endif$
\hypersetup{unicode=true,
$if(title-meta)$
pdftitle={$title-meta$},
$endif$
$if(author-meta)$
pdfauthor={$author-meta$},
$endif$
$if(keywords)$
pdfkeywords={$for(keywords)$$keywords$$sep$; $endfor$},
$endif$
$if(colorlinks)$
colorlinks=true,
linkcolor=$if(linkcolor)$$linkcolor$$else$Maroon$endif$,
citecolor=$if(citecolor)$$citecolor$$else$Blue$endif$,
urlcolor=$if(urlcolor)$$urlcolor$$else$Blue$endif$,
$else$
pdfborder={0 0 0},
$endif$
breaklinks=true}
\urlstyle{same} % don't use monospace font for urls
$if(lang)$
\ifnum 0\ifxetex 1\fi\ifluatex 1\fi=0 % if pdftex
\usepackage[shorthands=off,$for(babel-otherlangs)$$babel-otherlangs$,$endfor$main=$babel-lang$]{babel}
$if(babel-newcommands)$
$babel-newcommands$
$endif$
\else
\usepackage{polyglossia}
\setmainlanguage[$polyglossia-lang.options$]{$polyglossia-lang.name$}
$for(polyglossia-otherlangs)$
\setotherlanguage[$polyglossia-otherlangs.options$]{$polyglossia-otherlangs.name$}
$endfor$
\fi
$endif$
$if(natbib)$
\usepackage{natbib}
\bibliographystyle{$if(biblio-style)$$biblio-style$$else$plainnat$endif$}
$endif$
$if(biblatex)$
\usepackage$if(biblio-style)$[style=$biblio-style$]$endif${biblatex}
$if(biblatexoptions)$\ExecuteBibliographyOptions{$for(biblatexoptions)$$biblatexoptions$$sep$,$endfor$}$endif$
$for(bibliography)$
\addbibresource{$bibliography$}
$endfor$
$endif$
$if(listings)$
\usepackage{framed}
\usepackage{fancyvrb}
\usepackage{listings}
$endif$
$if(lhs)$
\lstnewenvironment{code}{\lstset{language=Haskell,basicstyle=\small\ttfamily}}{}
$endif$
\lstset{
language=haskell,
frame=ltb,
framerule=0pt,
xleftmargin=2pt,
framexleftmargin=16pt,
framextopmargin=25pt,
framexbottommargin=25pt,
stepnumber=1,
numbers=left,
numbersep=5pt,
numberstyle=\ttfamily\tiny\color[gray]{0.3},
belowcaptionskip=\bigskipamount,
captionpos=b,
escapeinside={*'}{'*},
tabsize=2,
emphstyle={\bf},
commentstyle=\it,
stringstyle=\mdseries\rmfamily,
showspaces=false,
keywordstyle=\bfseries\rmfamily,
columns=fullflexible,
basicstyle=\small\sffamily,
showstringspaces=false,
morecomment=[l]\%,
}
\usepackage[utf8]{inputenc}
\usepackage{ifxetex,ifluatex}
\usepackage{fontspec}
\setmainfont[Ligatures=Common,
ItalicFont={Adobe Garamond Pro Italic}]
{Adobe Garamond Pro}
\setmonofont[Ligatures=NoCommon]{Source Code Pro}
\urlstyle{same}
$if(highlighting-macros)$
$highlighting-macros$
$endif$
$if(verbatim-in-note)$
\usepackage{fancyvrb}
\VerbatimFootnotes % allows verbatim text in footnotes
$endif$
$if(tables)$
\usepackage{longtable,booktabs}
$endif$
@ -211,31 +140,33 @@ $for(header-includes)$
$header-includes$
$endfor$
$if(title)$
\title{$title$$if(thanks)$\thanks{$thanks$}$endif$}
$endif$
$if(subtitle)$
\providecommand{\subtitle}[1]{}
\subtitle{$subtitle$}
$endif$
$if(author)$
\author{$for(author)$$author$$sep$ \and $endfor$}
$endif$
$if(institute)$
\institute{$for(institute)$$institute$$sep$ \and $endfor$}
$endif$
\date{$date$}
\begin{document}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\begin{titlepage}
\vspace*{\stretch{1.0}}
\begin{center}
\Large\textbf{What I Wish I Knew When Learning Haskell}\\
\large\textit{Stephen Diehl}
\end{center}
\vspace*{\stretch{2.0}}
\definecolor{titlepagecolor}{HTML}{8A1C0A}
\definecolor{namecolor}{cmyk}{1,.50,0,.10}
\pagecolor{titlepagecolor}
\color{white}
\vspace*{\stretch{1.0}}
\begin{center}
\Huge\textbf{What I Wish I Knew When Learning Haskell}\\
\large\textit{Stephen Diehl}
\end{center}
\vspace*{\stretch{2.0}}
\begin{figure}
\centering
\includegraphics[height=3in,width=3in]{img/Haskell-Logo.ps}
\end{figure}
\end{titlepage}
\pagecolor{white}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
$if(abstract)$
\begin{abstract}

View File

@ -11,4 +11,6 @@
\newunicodechar{}{\ensuremath{\wedge}}
\newunicodechar{}{\ensuremath{\Rightarrow}}
\newunicodechar{}{\ensuremath{\sbullet}}
\newunicodechar{λ}{\ensuremath{\lambda}}
\newunicodechar{λ}{\ensuremath{\lambda}}
\newunicodechar{Λ}{\ensuremath{\Lambda}}
\newunicodechar{}{\ensuremath{\mathbb{N}}}

View File

@ -1277,6 +1277,27 @@ applyTwice f x = f (f x)
Type Signatures
---------------
```haskell
myFunction x y = x ^ 2 + y ^ 2
^ ^ ^ ^^^^^^^^^^^^^
| | | |
| | | +-- function body
| | +------ second argument
| +-------- first argument
+-------------- function
```
```haskell
myFunction :: Int -> Int -> Int
^ ^ ^ ^^^^^
| | | |
| | | +- return type
| | +------ second argument
| +------------ first argument
+----------------------- function
```
```haskell
f :: Integer -> Integer -> Integer
f x y = x + y