Open Gurkenglas opened 8 years ago
Can you provide an example where the benefit of that notation would be more clear?
I think I'd find this very confusing as a reader. Particulary when the various case patterns then appear to have different types.
evaluateMyLanguage :: Fix MyLanguage -> Int
evaluateMyLanguage = cata $ \case
Literal i -> i
Add x y -> x + y
Mul x y -> x * y
vs.
evaluateMyLanguage :: Fix MyLanguage -> Int
evaluateMyLanguage = cata $ \case
Literal -> id
Add -> (+)
Mul -> (*)
. It's also closer to each datatype's catamorphism (maybe for Maybe, bool for Bool, foldr for [], etc.)
There should be something that allows you to replace
with: