From 793e306e5fce1519601f7f82dcd0cb9b7a28c13f Mon Sep 17 00:00:00 2001
From: Julien Moutinho <julm+symantic-base@sourcephile.fr>
Date: Sat, 11 Sep 2021 20:45:45 +0200
Subject: [PATCH] iface: add instance `Category Iso`

---
 src/Symantic/Lang.hs | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/src/Symantic/Lang.hs b/src/Symantic/Lang.hs
index 1d76d16..47924b3 100644
--- a/src/Symantic/Lang.hs
+++ b/src/Symantic/Lang.hs
@@ -12,6 +12,7 @@ import Data.Kind (Type)
 import Data.Maybe (Maybe(..), fromJust)
 import Data.Proxy (Proxy(..))
 import GHC.Generics (Generic)
+import qualified Control.Category as Cat
 import qualified Data.Function as Fun
 import qualified Data.Tuple as Tuple
 
@@ -167,6 +168,9 @@ class IsoFunctor repr where
 
 -- ** Type 'Iso'
 data Iso a b = Iso { a2b :: a->b, b2a :: b->a }
+instance Cat.Category Iso where
+  id = Iso Cat.id Cat.id
+  f . g = Iso (a2b f Cat.. a2b g) (b2a g Cat.. b2a f)
 
 -- * Class 'ProductFunctor'
 -- | Beware that this is an @infixr@,
-- 
2.47.2