Elm Exactly
Results / elm-core /

MaybeMapIntToBoolTest

elm-0.19.1 passelm-0.19.2 passelm-0.19.3 passlamdera-1.5.0 pass
`Maybe.map` with an Int -> Bool function produces a `Maybe Bool`: mapping `\x -> x > 0` over `Just 42` gives `Just True`.

Results

elm-0.19.1

passran in 80 ms
Output
Compiled in DEV mode. Follow the advice at https://elm-lang.org/0.19.1/optimize for better performance and smaller assets.
result: Just True

elm-0.19.2

passran in 61 ms
Output
Compiled in DEV mode. Follow the advice at https://elm-lang.org/0.19.2/optimize for better performance and smaller assets.
result: Just True

elm-0.19.3

passran in 59 ms
Output
Compiled in DEV mode. Follow the advice at https://elm-lang.org/0.19.3/optimize for better performance and smaller assets.
result: Just True

lamdera-1.5.0

passran in 75 ms
Output
result: Just True

Discussions

Discuss this test·Search the discussions on GitHub

Discussions are on GitHub; one about this test has [t:elm-core/MaybeMapIntToBoolTest] in its title.

Source

The -- CHECK: lines give the expected output.

module MaybeMapIntToBoolTest exposing (main)
{-| `Maybe.map` with an Int -> Bool function produces a `Maybe Bool`: mapping `\x -> x > 0` over `Just 42` gives `Just True`.
-}
-- CHECK: result: Just True
import Html exposing (text)
main =
let
result =
Maybe.map (\x -> x > 0) (Just 42)
_ = Debug.log "result" result
in
text "done"