Changeset 814f87d for doc/theses/andrew_beach_MMath/intro.tex
- Timestamp:
- Sep 23, 2021, 3:36:04 PM (3 years ago)
- Branches:
- ADT, ast-experimental, enum, forall-pointer-decay, master, pthread-emulation, qualifiedEnum
- Children:
- 9411cf0
- Parents:
- 75c7252
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
doc/theses/andrew_beach_MMath/intro.tex
r75c7252 r814f87d 220 220 unwinding the stack like in termination exception 221 221 handling.\cite{RustPanicMacro}\cite{RustPanicModule} 222 Go's panic th rough is very similar to a termination, except it only supports222 Go's panic though is very similar to a termination, except it only supports 223 223 a catch-all by calling \code{Go}{recover()}, simplifying the interface at 224 224 the cost of flexibility.\cite{Go:2021} … … 265 265 This pattern is very popular in any functional or semi-functional language 266 266 with primitive support for tagged unions (or algebraic data types). 267 % We need listing Rust/rust to format code snippets from it. 268 % Rust's \code{rust}{Result<T, E>} 267 Return unions can also be expressed as monads (evaluation in a context) 268 and often are in languages with special syntax for monadic evaluation, 269 such as Haskell's \code{haskell}{do} blocks. 270 269 271 The main advantage is that an arbitrary object can be used to represent an 270 272 error, so it can include a lot more information than a simple error code. … … 272 274 execution, and if there aren't primitive tagged unions proper, usage can be 273 275 hard to enforce. 276 % We need listing Rust/rust to format code snippets from it. 277 % Rust's \code{rust}{Result<T, E>} 278 279 Return unions as monads will result in the same code, but can hide most 280 of the work to propagate errors in simple cases. The code to actually handle 281 the errors, or to interact with other monads (a common case in these 282 languages) still has to be written by hand. 274 283 275 284 \item\emph{Handler Functions}:
Note: See TracChangeset
for help on using the changeset viewer.