A Wizard b a is a conversation with the user via back-end b that will result in a data type a, or may fail.
A Wizard is made up of one or more "primitives" (see below), composed using the Applicative,
Monad and Alternative instances. The Alternative instance is, as you might expect, a maybe-style cascade.
If the first wizard fails, the next one is tried. mzero can be used to induce failure directly.
The Wizard constructor is exported here for use when developing backends, but it is better for end-users to simply pretend that Wizard is an opaque data type. Don't depend on this unless you have no other choice.
Wizards are, internally, just a maybe transformer over a free monad built from some coproduct of functors, each of which is a primitive action.
Instances6Monad, Functor, Applicative, Alternative, MonadPlus, MonadIO
Functor backend => Monad (Wizard backend)Defined in wizards-1.0.3 · System.Console.Wizard.InternalFunctor backend => Functor (Wizard backend)Defined in wizards-1.0.3 · System.Console.Wizard.InternalFunctor backend => Applicative (Wizard backend)Defined in wizards-1.0.3 · System.Console.Wizard.InternalFunctor backend => Alternative (Wizard backend)Defined in wizards-1.0.3 · System.Console.Wizard.InternalFunctor backend => MonadPlus (Wizard backend)Defined in wizards-1.0.3 · System.Console.Wizard.InternalArbitraryIO :<: b => MonadIO (Wizard b)Defined in wizards-1.0.3 · System.Console.Wizard · orphan