diff options
author | Greg Brown <greg.brown01@ed.ac.uk> | 2022-12-06 16:18:29 +0000 |
---|---|---|
committer | Greg Brown <greg.brown01@ed.ac.uk> | 2022-12-06 16:18:29 +0000 |
commit | fcd024cb01e484dc3c92212f4317b254bbd7580b (patch) | |
tree | 99f8f7f834524e38aed09b5abece1b2db47a8a01 /src/Data/Setoid/Product.idr | |
parent | 83c85bf396949287365a694a89e0f49a58cab5a2 (diff) |
Add smart constructor for first-order algebras.refactor/strict
Diffstat (limited to 'src/Data/Setoid/Product.idr')
-rw-r--r-- | src/Data/Setoid/Product.idr | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/src/Data/Setoid/Product.idr b/src/Data/Setoid/Product.idr index 6693d40..b1e8ce3 100644 --- a/src/Data/Setoid/Product.idr +++ b/src/Data/Setoid/Product.idr @@ -101,6 +101,11 @@ wrapIntro [] = [] wrapIntro (r :: rs) = r :: wrapIntro rs public export +wrapFunc : (0 x : IndexedSetoid b) -> (0 f : a -> b) + -> Product (reindex f x) ~> reindex (map f) (Product x) +wrapFunc x f = MkIndexedSetoidHomomorphism (\_ => wrap f) (\_, _, _ => wrapIntro) + +public export unwrapIntro : forall f . {0 rel : (i : b) -> Rel (x i)} -> {is : _} -> {0 xs, ys : x ^ map f is} -> Pointwise rel xs ys -> Pointwise (\i => rel (f i)) {is = is} (unwrap f xs) (unwrap f ys) unwrapIntro {is = []} [] = [] |