And i forgot to include the defs of (co)prod:<br>
<br>coprod (<>) i1 i2 = (\a b -> i1 a <> i2 b)<br>prod (><) p1 p2 = (\a -> p1 a >< p2 a)<br><br>diag = foldr (curry (prod mappend<br> fst<br> snd<br>
. uncurry (coprod mappend<br> (splitAt 2)<br> (splitAt 1)))) []<br><br>Matt<br>