summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorGreg Brown <greg.brown01@ed.ac.uk>2022-12-06 09:08:19 +0000
committerGreg Brown <greg.brown01@ed.ac.uk>2022-12-06 09:08:19 +0000
commitc9b6934608ba01a8f7e2dd1ea29a4304c908b3dd (patch)
tree4f67ad324ce8214818c6cda66a68070b18224309 /src
parented3e73167a32999e1b99976f509ed9aee8da7a4a (diff)
Define setoid reindexing.
Diffstat (limited to 'src')
-rw-r--r--src/Data/Setoid/Indexed.idr4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/Data/Setoid/Indexed.idr b/src/Data/Setoid/Indexed.idr
index 7277932..a04b647 100644
--- a/src/Data/Setoid/Indexed.idr
+++ b/src/Data/Setoid/Indexed.idr
@@ -40,5 +40,9 @@ public export
(.index) x i = MkSetoid (x.U i) (x.relation i) (x.equivalence i)
public export
+reindex : (a -> b) -> ISetoid b -> ISetoid a
+reindex f x = MkISetoid (x.U . f) (\i => x.relation $ f i) (\i => x.equivalence $ f i)
+
+public export
isetoid : (a -> Type) -> ISetoid a
isetoid u = MkISetoid u (\_ => Equal) (\_ => equiv)