Skip to content

Commit

Permalink
Merge branch 'master' of github.com:EliasAAradsson/introprog
Browse files Browse the repository at this point in the history
  • Loading branch information
EliasAAradsson committed Jan 5, 2024
2 parents 6066e26 + c79beea commit b945cea
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions quickref/quickref.tex
Original file line number Diff line number Diff line change
Expand Up @@ -565,9 +565,6 @@
\end{tabular}
}% small

{\small Other collection-like methods on \textbf{Option}: foreach, isEmpty, filter, toVector, ..., on \textbf{Try}: map, foreach, toOption, ... }


\vspace{0.25em}
{\small\renewcommand{\arraystretch}{1.0}
{\textbf{Try[T]} is like a collection with \textbf{Success[T]} or \textbf{Failure[E]}.\hfill\code|import scala.util.{Try, Success, Failure}|}
Expand All @@ -580,6 +577,10 @@
\code|Try(1/0) match { case Success(x) => x; case Failure(e) => 0 }| %\Comment{~~e is ArithmeticException}
}

{\small Predicates on \textbf{Option}: isEmpty, isDefined. Predicates on \textbf{Try}: isSuccess, isFailure} \\
{\small Other collection-like methods on \textbf{Option}: foreach, flatMap, filter, toVector, ..., on \textbf{Try}: map, foreach, toOption, ... }




\vspace{0.5em}\head{Reading/writing from file, and standard in/out:}\Newline
Expand Down

0 comments on commit b945cea

Please sign in to comment.