Maintainer | Ertugrul Soeylemez <es@ertes.de> |
---|
Nondeterministic wires.
Nondeterministic wires
class Arrow >~ => WSplit (>~) whereSource
Split the wires in the sense of the underlying arrow. A thread
in this sense is called a branch. This makes most sense with some
logic monad (like a list monad transformer) wrapped in a Kleisli
arrow.
Warning: Incorrect usage will cause space leaks. Use with care!
branch :: Foldable f => Wire e >~ (f b) bSource
Splits the wire into a branch for each given input value. Additionally adds a single inhibiting branch.
Note: This wire splits at every instant. In many cases you
probably want to apply swallow
to it to split only in the first
instant.
- Branches: As many as there are input values + 1.
- Depends: Current instant.
- Inhibits: Always in one branch, never in all others.
Quits the current branch.
- Branches: Zero.
quitWith :: Wire e >~ b bSource
Acts like the identity wire in the first instant and terminates the branch in the next.
- Branches: One, then zero.
- Depends: Current instant.