To expand on that, this class basically allows you to prove your relation c holds pointwise across arbitrary binary trees, represented by nested tuples and terminated by ()s. If individual instances of the class had additional ways of constructing values (i.e., proving the relation for the two type parameters), then your trees could contain other types.
FullBinaryTreeRelation? :POn Tue, May 8, 2012 at 1:36 PM, MigMit <miguelimo38@yandex.ru> wrote:
Hi café, a quick question.
Is there a somewhat standard class like this:
class Something c where
unit :: c () ()
pair :: c x y -> c u v -> c (x, u) (y, v)
?
I'm using it heavily in my current project, but I don't want to repeat somebody else's work, and it seems general enough to be defined somewhere; but my quick search on Hackage didn't reveal anything.
I know about arrows; this, however, is something more general, and it's instances aren't always arrows.
_______________________________________________
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe