From 776e5ce0d6e295867ad755c6ca20ac0ac40bbe8e Mon Sep 17 00:00:00 2001 From: Denis Buzdalov Date: Thu, 26 Sep 2024 19:08:10 +0300 Subject: [PATCH] [ fix ] Fix and generalise interpolations for fin map and fin set --- src/Data/Fin/Map.idr | 4 ++-- src/Data/Fin/Set.idr | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/Data/Fin/Map.idr b/src/Data/Fin/Map.idr index 905d8cd..18e2979 100644 --- a/src/Data/Fin/Map.idr +++ b/src/Data/Fin/Map.idr @@ -169,8 +169,8 @@ rightMost : FinMap n v -> Maybe (Fin n, v) rightMost = last' . kvList export -Interpolation v => Interpolation (FinMap n v) where - interpolate = ("{" ++) . (++ "}") . joinBy ", " . map (\(i, v) => "i -> \{v}") . kvList +Interpolation v => Interpolation (Fin n) => Interpolation (FinMap n v) where + interpolate = ("{" ++) . (++ "}") . joinBy ", " . map (\(i, v) => "\{i} -> \{v}") . kvList export Eq v => Eq (FinMap n v) where diff --git a/src/Data/Fin/Set.idr b/src/Data/Fin/Set.idr index 2dce958..46b6c0a 100644 --- a/src/Data/Fin/Set.idr +++ b/src/Data/Fin/Set.idr @@ -120,8 +120,8 @@ export neutral = empty export -Interpolation (FinSet n) where - interpolate = ("{" ++) . (++ "}") . joinBy ", " . map show . Fin.Set.toList +Interpolation (Fin n) => Interpolation (FinSet n) where + interpolate = ("{" ++) . (++ "}") . joinBy ", " . map interpolate . Fin.Set.toList export null : FinSet n -> Bool