Random.map identity generator
--> generator
Random.map (always a) generator
--> Random.constant a
-- not in summary
Random.map << always
--> Random.map
Random.map f (Random.constant x)
--> Random.constant (f x)
-- not in summary
Random.map f << Random.constant
--> Random.constant << f
The generalized checks for map f (pure x) and map identity are also now re-used for existing Maybe.map, Result.map, ... checks
they are versatile and pretty: you can for example use them with Ok and map or with Err and mapError
As an unrelated change, I upgraded elm-syntax to the latest version to make the local tests pass
I feel like I could do another round of cleanups with better errors for error infos I marked TODO, more performant compositionChecks similar to functionCallChecks, changing ModuleName -> String -> ... to ( ModuleName, String ) -> ... etc
The amount of tests here kind of went out of hand (and the list isn't even complete). We could (from now on?) combine cases with equivalent/similar output to get a more focused file, slightly faster and less boring test creation, better performance (not that this has been a problem) but also a bit less clear errors. Thoughts?
part of https://github.com/jfmengels/elm-review-simplify/issues/109
Some comments
map f (pure x)
andmap identity
are also now re-used for existingMaybe.map
,Result.map
, ... checksOk
andmap
or withErr
andmapError
elm-syntax
to the latest version to make the local tests passcompositionChecks
similar tofunctionCallChecks,
changingModuleName -> String -> ...
to( ModuleName, String ) -> ...
etc