[ refactor ] make Data.List.Base.[_] a pattern synonym - #3095
[ refactor ] make Data.List.Base.[_] a pattern synonym#3095jamesmckinna wants to merge 5 commits into
Data.List.Base.[_] a pattern synonym#3095Conversation
|
Should we also do it in other places where it's a constructor? E.g. |
|
Yes, but doing this for UPDATED I just did them all, for the listlike ones at least. |
|
Were we to do this, should it be one giant PR, or a bunch of smaller ones? I am all in favour of explicit (On naming, I left a comment / question on #3073 about that.) |
|
Re: "one giant PR" I can't find much more to change than the above task list. |
As previously discussed, eg. #3073 (comment) .
The surprising thing is that I had expected this to break a lot of code, but... it doesn't, and those breakages arise from ambiguity of the name
pure, ... so one solution would be not to introduce that name for the function-associated-with-the-pattern-synonym. UPDATED the change frompuretosingletonsimplifies this analysis, but at the cost of a non-uniformity of concept with the use ofsingletonas a definition underData.Tree.*.Another is to do a another round of more invasive weeding of
imports in favour of qualified imports, and avoidinghidingdirectives. Currently, this PR does the bare minimum necessary (actually, it might be sufficient to do even slightly less... ;-))Other similar definitions presumably falls to a corresponding analysis: (thanks to @gallais for the prompt)
Data.Vec.Base.[_]Data.List.NonEmpty.Base.[_]Data.List.Fresh.NonEmpty.[_](is this replaceable with a pattern synonym?)Data.DifferenceList.Base.[_](this probably should only be replaced by asyntaxdeclaration)