
Nathan Hüsken
The problem with such an interface is the inflexibility. Notice that removing a subwire will change the numbering of all subsequent wires. The interface I suggested follows this basic idea:
shrinking :: (Monad m) => [(a' -> a, Wire e m a b)] -> Wire e m a' b
That should be ".. -> Wire e m a' [b]", correct?
Yes, of course.
The reasoning is that this way you disconnect the individual values from the positions in the subwire list. This will also make writing the combinator a bit simpler. If you will here is an interesting alternative:
data Subwire e m a b = forall a'. Subwire (a -> a') (Wire e m a' b)
shrinking :: (Monad m) => [Subwire e m a b] -> Wire e m a b
Ohh, the scary forall keyword :). Here it does nothing but hide the a' type from the type signature, is that correct?
It also localizes error messages to where your subwire is defined. Greets, Ertugrul -- Not to be or to be and (not to be or to be and (not to be or to be and (not to be or to be and ... that is the list monad.