mirror of
https://github.com/github/semantic.git
synced 2024-12-22 22:31:36 +03:00
Add a Switch case to zipUnwrap
This commit is contained in:
parent
0c1d749f32
commit
af8e7a4d81
@ -33,6 +33,9 @@ zipTerms t1 t2 = annotate (zipUnwrap a b)
|
||||
zipUnwrap (Case eA' bodyA') (Case eB' bodyB') = case (zipTerms eA' eB', zipTerms bodyA' bodyB') of
|
||||
(Just id', Just body') -> Just $ Case id' body'
|
||||
_ -> Nothing
|
||||
zipUnwrap (Switch a' as') (Switch b' bs') = case (zipTerms a' b') of
|
||||
(Just expr') -> Just $ Switch expr' (catMaybes $ zipWith zipTerms as' bs')
|
||||
_ -> Nothing
|
||||
zipUnwrap (Fixed a') (Fixed b') = Just . Fixed . catMaybes $ zipWith zipTerms a' b'
|
||||
zipUnwrap (Keyed a') (Keyed b') | keys a' == keys b' = Just . Keyed . fromList . catMaybes $ zipUnwrapMaps a' b' <$> keys a'
|
||||
zipUnwrap _ _ = Nothing
|
||||
|
Loading…
Reference in New Issue
Block a user