Safe Haskell | Safe-Inferred |
---|
Control.Operational.Instruction
Description
Utility functions for working with instructions and instruction sets.
The Data.Functor.Coproduct module is very useful with instruction
sets, so this module reexports it. The Coproduct
type can be
used to take the union of two instruction sets, and the coproduct
function can be used to construct an instruction evaluation for
such an union. So if we have these two instruction evaluations:
evalI :: forall x. instr x -> f x evalI' :: forall x. instr' x -> f x
then their coproduct
is an evaluation for the union of the
instruction sets:
coproduct evalI evalI' :: forall x. (Coproduct instr instr' x) -> f x