jfmengels/elm-review-simplify

Add simplifications for elm-explorations/test

Open

#108 opened on May 10, 2023

View on GitHub
 (2 comments) (1 reaction) (0 assignees)Elm (10 forks)github user discovery
enhancementhelp wanted

Repository metrics

Stars
 (22 stars)
PR merge metrics
 (PR metrics pending)

Description

So far Simplify only supports core Elm packages (in part because they're really stable), but I think the elm-explorations ones could warrant being handled as well.

Here are some I could think of, but I'm sure a pass over the API could find more.

Expect

-- To help with transitioning from v1 to v2
Expect.true string value
--> foo
-->  |> Expect.equal True
-->  |> Expect.onFail string

Expect.false string value
--> value
-->  |> Expect.equal False
-->  |> Expect.onFail string

Fuzz

Fuzz.filter (always True) a
--> a

Fuzz.filter (always False) a
--> ???

Fuzz.map identity a
--> a

Fuzz.andThen Fuzz.constant a
--> a

Fuzz.andThen (\b -> Fuzz.constant (f b)) a
--> Fuzz.map (\b -> f b) a
  • Something with Fuzz.constants?
  • Something about Fuzz.lazy being useless?

Contributor guide