-
Notifications
You must be signed in to change notification settings - Fork 602
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
WIP - Kotlin Edition configuration files
- Loading branch information
1 parent
89589f8
commit 2f0edd8
Showing
10 changed files
with
80 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
% !TEX root = ctfp-print.tex | ||
|
||
\lettrine[lhang=0.17]{T}{his is the Kotlin edition} of \emph{Category Theory for Programmers}. | ||
It's been a tremendous success, making Bartosz Milewski's blog post series available as a nicely | ||
typeset \acronym{PDF}, as well as a hardcover book. There have been numerous contributions made | ||
to improve the book, by fixing typos and errors, as well as translating the code snippets into | ||
other programming languages. | ||
|
||
I am thrilled to present this edition of the book, containing the original Haskell code, followed by | ||
its Kotlin counterpart. The Kotlin code snippets were generously provided by | ||
\urlref{https://github.com/arrow-kt/Category-Theory-for-Programmers.kt}{ΛRROW} contributors, slightly | ||
modified to suit the format of this book. | ||
|
||
To support code snippets in multiple languages, I am using a \LaTeX{} macro to load the code snippets | ||
from external files. This allows easily extending the book with other languages, while leaving the | ||
original text intact. Which is why you should mentally append the words ``and Kotlin'' whenever you see | ||
``in Haskell'' in the text. | ||
|
||
The code is laid out in the following manner: the original Haskell code, followed by Kotlin code. | ||
To distinguish between them, the code snippets are braced from the left with a vertical bar, in the primary | ||
color of the language's logo, \raisebox{-.2mm}{\includegraphics[height=.3cm]{fig/icons/haskell.png}}, | ||
and \raisebox{-.2mm}{\includegraphics[height=.3cm]{fig/icons/kotlin.png}} respectively, e.g.: | ||
|
||
\srcsnippet{content/1.5/code/haskell/snippet15.hs}{blue}{haskell} | ||
\unskip | ||
\srcsnippet{content/1.5/code/kotlin/snippet15.kt}{orange}{kotlin} | ||
\NoIndentAfterThis | ||
TODO: In addition, some Scala snippets make use of the | ||
\urlref{https://github.com/non/kind-projector}{Kind Projector} compiler plugin, to support nicer syntax for partially-applied types. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
\input{opt-kotlin} | ||
\input{ctfp-print} | ||
\input{postamble} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
\input{opt-kotlin} | ||
\input{ctfp-reader} | ||
\input{postamble} |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
\def\OPTCustomLanguageKotlin{kotlin} | ||
\def\OPTCustomLanguageKotlinExt{kt} | ||
\def\OPTCustomLanguageKotlinColor{orange} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters