JustusAdam / language-haskell

Highlighting support for the Haskell language in visual studio code.
https://marketplace.visualstudio.com/items/justusadam.language-haskell
BSD 3-Clause "New" or "Revised" License
96 stars 48 forks source link

LambdaCase \cases syntax #217

Closed mixphix closed 2 years ago

mixphix commented 2 years ago

Currently we have support for \case highlighting, but \cases (provided by this recently-merged GHC proposal) is not yet supported:

foo :: Maybe a -> Maybe b -> Maybe (a, b)
foo = \case
  Nothing -> Nothing
  Just a -> \case
    Nothing -> Nothing
    Just b -> Just (a, b)

bar :: Maybe a -> Maybe b -> Maybe (a, b)
bar = \cases
  (Just a) (Just b) -> Just (a, b)
  _ _ -> Nothing

I have already prepared a fork with a patch!