DEV Community

Discussion on: Language Idea: Limit custom types to three arguments

Collapse
 
pdamoc profile image
Petre Damoc

As far as I know, custom types with more than 3 parameters is the way to pattern match against more than 3 conditions. I don't have a readily available example BUT I remember Evan suggesting this as a workaround. Removing this facility would force people with that need to use cascading case statements.

Business logic can sometimes be crazy complex.

A change like this might be beneficial even in those complex cases as it might force a redesign that might improve the comprehension of complex code BUT still, it needs to be well thought out.

Collapse
 
robinheghan profile image
Robin Heggelund Hansen

I agree. I have several examples of that, just check out the Dict implementation in elm/core.

So my suggestion isn't really feasible unless records get better pattern matching. But I guess that has it's own downsides? :/