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

Return result of program from internal execute function #104

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

istathar
Copy link
Member

@istathar istathar commented Mar 21, 2022

Refactor executeActual to be an silently exposed function returning a value. The signature is

executeActual :: Context τ -> Program τ α -> IO α

This is called by execute and executeWith already; they just discard that value.

This may be the missing link to support proper test machinery for the Program monad. The real test would be if it can be used multiple times in succession in a GHCi session; that would imply we've got the resource cleanup completely solid.

@istathar istathar self-assigned this Mar 21, 2022
@istathar
Copy link
Member Author

Something's not right:

λ> context <- configure "0" None blankConfig
λ> executeActual context (do { setVerbosityLevel Debug ; debug "what" (packRope "The") })
12:14:30Z (01.851) what = The
λ> executeActual context (do { setVerbosityLevel Debug ; debug "what" (packRope "The") })
<HANGS>

In fact it hangs so badly ^C can't kill it off. Hm.

@istathar istathar added the experimental Experiment or work-in-progress. Not necessarily intended for merging label Feb 17, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
experimental Experiment or work-in-progress. Not necessarily intended for merging
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant