Skip to content

Commit

Permalink
Allow matching two empty KMaps
Browse files Browse the repository at this point in the history
  • Loading branch information
geo2a committed Jul 28, 2023
1 parent 56c35eb commit ef26fd1
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion library/Booster/Pattern/Match.hs
Original file line number Diff line number Diff line change
Expand Up @@ -269,7 +269,12 @@ match1
-- and, domain values, injections, maps: fail
_other ->
failWith $ DifferentSymbols app subj
-- matching on maps unsupported
----- KMap
-- empty maps match trivially with an empty substitution
match1
(KMap _ [] Nothing)
(KMap _ [] Nothing) = pure mempty
-- matching on non-empty maps is not supported
match1
t1@KMap{}
t2 = indeterminate t1 t2
Expand Down

0 comments on commit ef26fd1

Please sign in to comment.