Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
For examples, see https://github.com/alexfmpe/obelisk/tree/ae%40test-new-workflows.
which currently has this code inlined for faster prototyping. Now thatob run
supports loading dependencies into its repl, I'll switch to that instead.The advantage of
Wizard
andStack
overWorkflow
is that they can be composed easily. AWorkflow
declares all its future replacements up-front, whileWizard
andStack
pieces can be created from am (Event t a)
widget, with a life-cycle then being specified by chaining several widgets monadically. AFAICT this is similar to Concur'sWidget
Only one layer of a
Wizard
exists at any given time. Each time a wizard layer triggers itsEvent
, it is completely replaced by the following one.Wizard
is adapted from https://github.com/reflex-frp/reflex/compare/workflow-monad.All layers of a
Stack
arecan be present at the same time. Each time one layer triggers itsEvent
, its entire sub-stack is replaced with a single child layer.AStack
can be made incremental with recourse toMaybeT
.Stack
(or rather, something that looked similar but was completely bugged) was discovered by accident while trying to get away with type tetris and failing miserably.The same temporal flow can be re-used for
Stack
andWizard
:To-do in no particular order:
unsafeCoerce
Bind
/Monad
and didn't pay much attention to the rest.Workflow
andWizard