Back to search

University of Kansas

Promise Land: Proving Correctness with Strongly Typed Javascript-Style Promises

Abstract

dc:description.abstract

Code that can run asynchronously is important in a wide variety of situations, from user interfacesto communication over networks, to the use of concurrency for performance gains. One widely- used method of specifying asynchronous control flow is the Promise model as used in Javascript. Promises are powerful, but can be confusing and hard to debug. This problem is exacerbated by Javascript’s permissive type system, where erroneous code is likely to fail silently, with values being implicitly coerced into unexpected types at runtime. The work presented here implements Javascript-style Promises in Haskell, translating the model to a strongly typed framework where we can use the type system to rule out some classes of bugs. Common errors — such as failure to call one of the callbacks of an executor, which would, in Javascript, leave the Promise in an eternally-pending deadlock state — can be detected for free by the type system at compile time and corrected without even needing to run the code. Along the way, we demonstrate that Promises form a monad, providing a monad instance that allows code using Promises to be written using Haskell’s do notation.

Degree

thesis:*
Name thesis:degree_name
M.S.
Discipline thesis:degree_discipline
Electrical Engineering & Computer Science
Grantor dc:publisher
University of Kansas
Year dc:date.issued
2022

Author and committee

dc:creator, dc:contributor.*
Author dc:creator
  • Elliott, Andrei Darien
Advisor dc:contributor.advisor
  • Moore, Matthew
Committee members dc:contributor.committeemember
  • Alexander, Perry
  • Davidson, Drew
ORCID dc:identifier.orcid

Subjects

dc:subject × 5

Rights

dc:rights
Statement dc:rights
  • Copyright held by the author.
Language dc:language.iso
en

Identifiers

dc:identifier.*

Chain of custody

source
Harvested from
University of Kansas
Base URL
kuscholarworks.ku.edu/server/oai/request
Last updated
2026-11-19
Source record
OAI-PMH GetRecord
citation

Elliott, Andrei Darien. Promise Land: Proving Correctness with Strongly Typed Javascript-Style Promises. University of Kansas, 2022. https://hdl.handle.net/1808/34974