1
1
mirror of https://github.com/github/semantic.git synced 2024-11-29 11:02:26 +03:00

Define an Element instance for matching on the left.

This commit is contained in:
Rob Rix 2019-09-23 15:02:17 -04:00
parent fe76c3dca6
commit 4199011b42
No known key found for this signature in database
GPG Key ID: F188A01508EA1CF7

View File

@ -143,3 +143,8 @@ instance {-# OVERLAPPABLE #-}
reassoc (L1 (L1 l)) = L1 l
reassoc (L1 (R1 l)) = R1 (L1 l)
reassoc (R1 r) = R1 (R1 r)
instance {-# OVERLAPPABLE #-}
Element t (t :+: r) where
prj (L1 l) = Just l
prj _ = Nothing