1
1
mirror of https://github.com/sdiehl/wiwinwlh.git synced 2024-08-16 23:40:41 +03:00

Write more

This commit is contained in:
sdiehl 2020-02-16 12:21:25 +00:00
parent 312f9ac104
commit 4b844395d5
4 changed files with 47 additions and 51 deletions

1
.gitignore vendored
View File

@ -11,6 +11,7 @@ includes
*.epub
*.pdf
*.docx
tutorial.tex
.stack-work
dist-newstyle
resources/*.eps

View File

@ -44,8 +44,13 @@ includes: includes.hs
(cat $(ETEMPLATE); ./includes < $<) \
| $(PANDOC) -f $(IFORMAT) -t epub $(FLAGS) $(EFLAGS) -o $@
%.tex: %.md includes $(COVER) $(BACK)
./includes < $< \
| $(PANDOC) -c -s -f $(IFORMAT) --template $(LTEMPLATE) --include-in-header $(UNICODE_MAP) --pdf-engine=xelatex $(FLAGS) $(LFLAGS) -o $@
%.pdf: %.md includes $(COVER) $(BACK)
./includes < $< | $(PANDOC) -c -s -f $(IFORMAT) --template $(LTEMPLATE) --include-in-header $(UNICODE_MAP) --pdf-engine=xelatex $(FLAGS) $(LFLAGS) -o $@
./includes < $< \
| $(PANDOC) -c -s -f $(IFORMAT) --template $(LTEMPLATE) --include-in-header $(UNICODE_MAP) --pdf-engine=xelatex $(FLAGS) $(LFLAGS) -o $@
links:
brok tutorial.md

View File

@ -1,17 +1,19 @@
\documentclass[10pt,openright]{$documentclass$}
\usepackage{geometry}
\usepackage{afterpage}
\usepackage{resources/dtrt}
\geometry{
%a4paper,
%total={21.59cm,27.94cm},
%total={21cm,25cm},
papersize={21cm,25cm},
%papersize={21cm,25cm},
papersize={8.125in,10.250in},
top=1.5cm,
bottom=1.5cm,
bottom=1.3cm,
inner=1.91cm,
outer=6.68cm,
% For pdf
left=1.5cm,
left=1.5cm,
right=1.5cm,
% For print
%marginparwidth=4cm,
@ -34,7 +36,6 @@ $if(colorlinks)$
pdfauthor={Stephen Diehl},
pdfsubject={Haskell Programming},
pdftitle={What I Wish I Knew When Learning Haskell},
pdfkeywords={LaTeX, PDF, hyperlinks}
}
$else$
\hypersetup{%
@ -44,7 +45,6 @@ $else$
pdfauthor={Stephen Diehl},
pdfsubject={Haskell Programming},
pdftitle={What I Wish I Knew When Learning Haskell},
pdfkeywords={LaTeX, PDF, hyperlinks}
}
\newif\ifprint
@ -58,17 +58,22 @@ $else$
\fi
$endif$
\newcommand\blankpage{%
\null
\thispagestyle{empty}%
\addtocounter{page}{-1}%
\newpage}
\usepackage{amssymb,amsmath}
\usepackage{framed}
\usepackage{fancyvrb}
\usepackage{fancyhdr}
\usepackage{graphicx}
%\usepackage{pst-poker}
\pagestyle{fancy}
\fancyhf{}
\fancyhead[RE,LO]{\leftmark}
\fancyhead[LE,RO]{\thepage}
\fancyhead[RE,LO]{\thepage}
\fancyhead[LE,RO]{\leftmark}
\renewcommand{\chaptermark}[1]{\markboth{\MakeUppercase{#1}}{}}
@ -89,8 +94,8 @@ $endif$
framerule=0pt,
xleftmargin=15pt,
framexleftmargin=16pt,
framextopmargin=25pt,
framexbottommargin=25pt,
framextopmargin=10pt,
framexbottommargin=10pt,
stepnumber=1,
numbers=left,
numbersep=5pt,
@ -116,10 +121,9 @@ $endif$
\usepackage[utf8]{inputenc}
\usepackage{ifxetex,ifluatex}
\usepackage{fontspec}
\setmainfont[Ligatures=Common,
ItalicFont={Adobe Garamond Pro Italic}]
\setmainfont[Ligatures=Common, ItalicFont={Adobe Garamond Pro Italic}]
{Adobe Garamond Pro}
\setmonofont[Ligatures=NoCommon, Scale=0.8]{Source Code Pro}
\setmonofont[Ligatures=NoCommon, Scale=0.75]{Source Code Pro}
\urlstyle{same}
\usepackage{longtable,booktabs}
@ -151,6 +155,7 @@ $if(numbersections)$
$else$
\setcounter{secnumdepth}{0}
$endif$
$if(subparagraph)$
$else$
% Redefines (sub)paragraphs to behave more like sections
@ -163,6 +168,7 @@ $else$
\renewcommand{\subparagraph}[1]{\oldsubparagraph{#1}\mbox{}}
\fi
$endif$
$if(dir)$
\ifxetex
% load bidi as late as possible as it modifies e.g. graphicx
@ -180,6 +186,7 @@ $if(dir)$
\newenvironment{LTR}{\beginL}{\endL}
\fi
$endif$
$for(header-includes)$
$header-includes$
$endfor$
@ -208,12 +215,12 @@ $if(toc)$
{
\setcounter{tocdepth}{$toc-depth$}
\tableofcontents
\newpage
}
$endif$
\newpage
\clearpage
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
$body$
@ -226,7 +233,10 @@ $endfor$
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\afterpage{\blankpage}
\clearpage
\newpage
\input{resources/back.tex}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

View File

@ -650,19 +650,14 @@ version if the lower bound at the currently used version.
```perl
build-depends:
base >= 4.6 && <4.14,
array >= 0.4 && <0.6,
ghc-prim >= 0.3 && <0.6,
async >= 2.0 && <2.3,
deepseq >= 1.3 && <1.5,
containers >= 0.5 && <0.7,
hashable >= 1.2 && <1.4,
transformers >= 0.2 && <0.6,
text >= 1.2 && <1.3,
stm >= 2.4 && <2.6,
bytestring >= 0.10 && <0.11,
mtl >= 2.1 && <2.3,
mtl-compat >= 0.2 && <0.3,
transformers-compat >= 0.4 && <0.7
```
Individual lines in the version specification can be dependent on other
@ -6466,28 +6461,6 @@ data Tree a = Node a [Tree a]
deriving (Show, Functor, Foldable, Traversable)
```
split
-----
The [split](http://hackage.haskell.org/package/split-0.1.1/docs/Data-List-Split.html) package provides a
variety of missing functions for splitting list and string types.
~~~~ {.haskell include="src/06-prelude/split.hs"}
~~~~
monad-loops
-----------
The [monad-loops](http://hackage.haskell.org/package/monad-loops-0.4.2/docs/Control-Monad-Loops.html) package
provides a variety of missing functions for control logic in monadic contexts.
```haskell
whileM :: Monad m => m Bool -> m a -> m [a]
untilM :: Monad m => m a -> m Bool -> m [a]
iterateUntilM :: Monad m => (a -> Bool) -> (a -> m a) -> a -> m a
whileJust :: Monad m => m (Maybe a) -> (a -> m b) -> m [b]
```
<hr/>
Strings
@ -6602,8 +6575,7 @@ fluffy :: Cat
fluffy = "Fluffy"
```
Import Conventions
------------------
**Import Conventions**
Since there are so many modules that provide string datatypes, and these modules
are used ubiquitously, some conventions are often adopted to import these
@ -6763,6 +6735,15 @@ Escape Unicode Character
\\v U+000B vertical tab
\\" U+0022 double quote
String Splitting
----------------
The [split](http://hackage.haskell.org/package/split-0.1.1/docs/Data-List-Split.html) package provides a
variety of missing functions for splitting list and string types.
~~~~ {.haskell include="src/06-prelude/split.hs"}
~~~~
<hr/>
@ -16785,9 +16766,9 @@ The long answer: It is not strictly necessary to learn, but so few things in
life are. Learning new topics and ways of thinking about problems only enrich
your thinking and give you new ways of thinking about code and abstractions.
Category theory is never going to help you write a web application better but it
may give you insights into problems that algebraic in nature. A few (read as
less than 10) or so Haskellers espouse philosophies about it being an
inspiration for certain abstractions, but most do not.
may give you insights into problems that algebraic in nature. A tiny group of
Haskellers espouse philosophies about it being an inspiration for certain
abstractions, but most do not.
Some understanding of abstract algebra, conventions for discussing algebraic
structures and equation reasoning with laws are essential to modern Haskell and
@ -16819,11 +16800,10 @@ specific names.
Constants are specific elements of the set, that generalise values like 0 and 1
which have specific laws in relation to the operations defined over the set.
Several of the common algebraic laws are defined in the table below:
Certain properties show up so frequently we typically refer to their properties
by an algebraic term. These terms are drawn from an equivalent abstract algebra
concept.
concept. Several of the common algebraic laws are defined in the table below.
```{=latex}
\noindent\rule{\textwidth}{1pt}