Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

#103, Provide import when @tailrec, fixed #104

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions sofp-src/lyx/sofp-appendices.lyx
Original file line number Diff line number Diff line change
Expand Up @@ -40623,6 +40623,11 @@ status open

\begin_layout Plain Layout

import scala.annotation.tailrec
\end_layout

\begin_layout Plain Layout

@tailrec def pairs(goal: Int, xs: Array[Int])(
\end_layout

Expand Down Expand Up @@ -41069,6 +41074,11 @@ status open

\begin_layout Plain Layout

import scala.annotation.tailrec
\end_layout

\begin_layout Plain Layout

@tailrec def convergeN[X](p: X => Boolean)(x:X)(m:Int)(f: X => X): Option[X]
= {
\end_layout
Expand Down
32 changes: 31 additions & 1 deletion sofp-src/lyx/sofp-induction.lyx
Original file line number Diff line number Diff line change
Expand Up @@ -12328,6 +12328,11 @@ status open

\begin_layout Plain Layout

import scala.annotation.tailrec
\end_layout

\begin_layout Plain Layout

@tailrec def fromDigits(s: Seq[Int], res: Int = 0): Int =
\end_layout

Expand Down Expand Up @@ -13218,7 +13223,7 @@ def f[A, B](s: Seq[A], b: B, g: (A, B) => B): B =

\begin_layout Plain Layout

else g(s.last, f(s.init, b, g)
else g(s.last, f(s.init, b, g))
\end_layout

\end_inset
Expand Down Expand Up @@ -13399,6 +13404,11 @@ status open

\begin_layout Plain Layout

import scala.annotation.tailrec
\end_layout

\begin_layout Plain Layout

@tailrec def leftFold[A, B](s: Seq[A], b: B, g: (B, A) => B): B =
\end_layout

Expand Down Expand Up @@ -20656,6 +20666,11 @@ status open

\begin_layout Plain Layout

import scala.annotation.tailrec
\end_layout

\begin_layout Plain Layout

@tailrec def binSearch(xs: Seq[Int], goal: Int): Int = ???
\end_layout

Expand Down Expand Up @@ -20730,6 +20745,11 @@ status open

\begin_layout Plain Layout

import scala.annotation.tailrec
\end_layout

\begin_layout Plain Layout

@tailrec def binSearch(xs: Seq[Int], goal: Int, acc: _ = ???): Int = {
\end_layout

Expand Down Expand Up @@ -20862,6 +20882,11 @@ status open

\begin_layout Plain Layout

import scala.annotation.tailrec
\end_layout

\begin_layout Plain Layout

@tailrec def binSearch(xs: Seq[Int], goal: Int)(left: Int = 0, right: Int
= xs.length): Int = {
\end_layout
Expand Down Expand Up @@ -25111,6 +25136,11 @@ status open

\begin_layout Plain Layout

import scala.annotation.tailrec
\end_layout

\begin_layout Plain Layout

@tailrec def commonInt(xs: Seq[Int], ys: Seq[Int]): Seq[Int] = ???
\end_layout

Expand Down
5 changes: 5 additions & 0 deletions sofp-src/lyx/sofp-summary.lyx
Original file line number Diff line number Diff line change
Expand Up @@ -2042,6 +2042,11 @@ status open

\begin_layout Plain Layout

import scala.annotation.tailrec
\end_layout

\begin_layout Plain Layout

implicit class IteratorOps[A](val it: Iterator[A]) extends AnyVal {
\end_layout

Expand Down