Skip to content

Commit b1bff91

Browse files
committed
Put template on its own line, except for one-liners
1 parent 683e195 commit b1bff91

File tree

2 files changed

+6
-4
lines changed

2 files changed

+6
-4
lines changed

src/content/1.4/kleisli-categories.tex

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -282,7 +282,8 @@ \section{The Writer Category}
282282
string to the log:
283283

284284
\begin{snip}{cpp}
285-
template<class A> Writer<A> identity(A x) {
285+
template<class A>
286+
Writer<A> identity(A x) {
286287
return make_pair(x, "");
287288
}
288289
\end{snip}
@@ -410,7 +411,8 @@ \section{Challenge}
410411
type \code{optional}:
411412

412413
\begin{snip}{cpp}
413-
template<class A> class optional {
414+
template<class A>
415+
class optional {
414416
bool _isValid;
415417
A _value;
416418
public:

src/content/1.5/products-and-coproducts.tex

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -244,8 +244,8 @@ \section{Products}
244244
In C++, we would use template functions, for instance:
245245

246246
\begin{snip}{cpp}
247-
template<class A, class B> A
248-
fst(pair<A, B> const & p) {
247+
template<class A, class B>
248+
A fst(pair<A, B> const & p) {
249249
return p.first;
250250
}
251251
\end{snip}

0 commit comments

Comments
 (0)