[Haskell-cafe] Re: Functional dependencies and Peano numbers

Jose A. Ortega Ruiz jao at gnu.org
Sat Jul 10 18:43:47 EDT 2010

On Sat, Jul 10 2010, wren ng thornton wrote:


> Yes, you can add multiple dependencies. The syntax is to use , after
> the first |.
> While having eight parameters is surely a desperate need for
> refactoring, there are times when you'd want multiple dependencies.
> For example, you can say
>     class F a b | a -> b, b -> a where...
> to express a bijective function on types (that is, for every pair of A
> and B, if you know one of them then you know what the other must be
> uniquely).

I know i should read the relevant articles, but how would one express
such a bijection using type families?

You err by thinking simplicity and elegance are mostly
cosmetic.  Simplicity and elegance are overwhelmingly
practical virtues.
  - William D Clinger, comp.lang.scheme

More information about the Haskell-Cafe mailing list