_Products in Hask._

Recall that Haskell has a built-in product (pair) type with constructors written:

> data (a,b) = (a,b)

Implement isomorphisms of the following type signatures by drawing diagrams and translating them into code. Explain why the functions you have constructed are isomorphisms.

(a) swap :: (a,b) -> (b,a)

(b) unit :: a -> ((),a)

(c) assoc :: (a,(b,c)) -> ((a,b),c)

***

[Next](https://forum.azimuthproject.org/discussion/2416/question-2-7-the-product-of-categories)

[Prev](https://forum.azimuthproject.org/discussion/2414/question-2-5-products-in-preorders)

[All](https://forum.azimuthproject.org/categories/exercises-applied-category-theory-course)

Recall that Haskell has a built-in product (pair) type with constructors written:

> data (a,b) = (a,b)

Implement isomorphisms of the following type signatures by drawing diagrams and translating them into code. Explain why the functions you have constructed are isomorphisms.

(a) swap :: (a,b) -> (b,a)

(b) unit :: a -> ((),a)

(c) assoc :: (a,(b,c)) -> ((a,b),c)

***

[Next](https://forum.azimuthproject.org/discussion/2416/question-2-7-the-product-of-categories)

[Prev](https://forum.azimuthproject.org/discussion/2414/question-2-5-products-in-preorders)

[All](https://forum.azimuthproject.org/categories/exercises-applied-category-theory-course)