Skip to content

Commit

Permalink
[ fix ] Fix and generalise interpolations for fin map and fin set
Browse files Browse the repository at this point in the history
  • Loading branch information
buzden committed Sep 26, 2024
1 parent 9c7076c commit 776e5ce
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions src/Data/Fin/Map.idr
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions src/Data/Fin/Set.idr
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 776e5ce

Please sign in to comment.