-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(primer): add app-level handlers for eval via interpretation
This commit only adds these handlers at the `Primer.App` module level. Hooking the interpreter up to the API and HTTP service will come in subsequent commits. Note that we add two handlers, one for time-bounded requests, and one for unbounded requests. We will not expose the unbounded handler via the HTTP API, since that would not be safe, but for local Haskell programs, it might be useful to run the unbounded interpreter and handle exceptions, timeouts, etc. in an application-specific manner, which the time-bounded interpreter doesn't really make possible. The time-bounded handler needs an additional `MonadIO` constraint because the variant of the interpreter that it uses handles timeouts and other imprecise exceptions that may be thrown by the interpreter. This is unlike any other actions in `Primer.App`, but it's unavoidable due to our particular lazy implementation of the interpreter. (See the comments in the interpreter source for details.) Signed-off-by: Drew Hess <src@drewhess.com>
- Loading branch information
Showing
6 changed files
with
517 additions
and
92 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.