jfmengels / elm-review-simplify

Provides elm-review rules to simplify your Elm code
https://package.elm-lang.org/packages/jfmengels/elm-review-simplify/latest/
BSD 3-Clause "New" or "Revised" License
20 stars 9 forks source link

String.fromList and String.toList chained simplifications #183

Closed lue-bird closed 11 months ago

lue-bird commented 11 months ago

182 without the first 4 commits.

String.fromList (String.toList str)
--> str

String.toList (String.fromList list)
--> list

-- all below are not in summary
String.toList << String.fromList
--> identity

String.fromList << String.toList
--> identity

String.toList << (String.fromList << f)
--> f

(f << String.toList) << String.fromList
--> f

String.fromList << (String.toList << f)
--> f

(f << String.fromList) << String.toList
--> f

and all variations with <</>>

Not fully confident that the error messages are easy to understand/read.

jfmengels commented 11 months ago

Really nice! Do we have an issue for simplifying Set.toList >> Set.fromList that you mentioned in here? Or do you have a personal todo list for that?

lue-bird commented 11 months ago

I don't have a personal todo list. Added https://github.com/jfmengels/elm-review-simplify/issues/184