diff options
author | Chloe Brown <chloe.brown.00@outlook.com> | 2024-01-22 12:11:20 +0000 |
---|---|---|
committer | Chloe Brown <chloe.brown.00@outlook.com> | 2024-01-22 12:11:20 +0000 |
commit | f0f44fe7815435836bc625e837e891188ae8d801 (patch) | |
tree | a695ae6fee918ffa653502ad000e75997d221d75 /src/Encoded/Pair.idr | |
parent | 5d5807f215805f1e235a0ad0546f995dd19a6767 (diff) |
Fix some bug?
I don't really know. I haven't read this in a long time.
Diffstat (limited to 'src/Encoded/Pair.idr')
-rw-r--r-- | src/Encoded/Pair.idr | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/src/Encoded/Pair.idr b/src/Encoded/Pair.idr index 5873e40..4b66cfe 100644 --- a/src/Encoded/Pair.idr +++ b/src/Encoded/Pair.idr @@ -39,6 +39,11 @@ bimap = Abs $ Abs $ Abs $ Abs $ ] export +mapFst : {ty1, ty1', ty2 : Ty} -> Term ((ty1 ~> ty1') ~> ty1 * ty2 ~> ty1' * ty2) ctx +mapFst = AbsAll [<_,_] (\[<f, x] => + App pair [<App (f . fst) [<x], App snd [<x]]) + +export mapSnd : {ty1, ty2, ty2' : Ty} -> Term ((ty2 ~> ty2') ~> ty1 * ty2 ~> ty1 * ty2') ctx mapSnd = Abs $ Abs $ let f = Var (There Here) in |