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

Add Random.andThen simplifications #159

Closed lue-bird closed 12 months ago

lue-bird commented 12 months ago

With that, #109 is fully implemented.

Random.andThen f (Random.constant x)
--> f x

Random.andThen Random.constant generator
--> generator

Random.andThen (\a -> Random.constant b) generator
--> Random.map (\a -> b) generator

Random.andThen (always thenGenerator) generator
--> thenGenerator

-- not in summary
Random.andThen (always thenGenerator)
--> (always thenGenerator)