summaryrefslogtreecommitdiff
path: root/src/Soat/Data/Product.idr
diff options
context:
space:
mode:
Diffstat (limited to 'src/Soat/Data/Product.idr')
-rw-r--r--src/Soat/Data/Product.idr11
1 files changed, 11 insertions, 0 deletions
diff --git a/src/Soat/Data/Product.idr b/src/Soat/Data/Product.idr
index f392a2d..0cb5dda 100644
--- a/src/Soat/Data/Product.idr
+++ b/src/Soat/Data/Product.idr
@@ -192,6 +192,17 @@ namespace Pointwise
pwTrans f [] [] = []
pwTrans f (r :: rs) (s :: ss) = transitive r s :: pwTrans f rs ss
+ public export
+ pwEquivalence : IEquivalence x rel -> {is : _} -> Setoid.Equivalence (x ^ is) (Pointwise rel)
+ pwEquivalence eq = MkEquivalence
+ (MkReflexive $ pwRefl (\i => (eq i).refl))
+ (MkSymmetric $ pwSym (\i => (eq i).sym))
+ (MkTransitive $ pwTrans (\i => (eq i).trans))
+
+ public export
+ pwSetoid : ISetoid a -> List a -> Setoid
+ pwSetoid x is = MkSetoid (x.U ^ is) _ (pwEquivalence x.equivalence)
+
-- Introductors and Eliminators
public export