MaybeMapFloatToBoolTest
`Maybe.map` with a Float -> Bool function produces a `Maybe Bool`: mapping `\x -> x > 0` over `Just 42.0` gives `Just True`.
Results
elm-0.19.1
passran in 39 msOutput
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 45 msOutput
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 40 msOutput
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 67 msOutput
result: Just True
Discussions
Discuss this test·Search the discussions on GitHub
Discussions are on GitHub; one about this test has [t:elm-core/MaybeMapFloatToBoolTest] in its title.
Source
The -- CHECK: lines give the expected output.
module MaybeMapFloatToBoolTest exposing (main)
{-| `Maybe.map` with a Float -> Bool function produces a `Maybe Bool`: mapping `\x -> x > 0` over `Just 42.0` gives `Just True`.
-}
-- CHECK: result: Just True
import Html exposing (text)
main =
let
result =
Maybe.map (\x -> x > 0) (Just 42.0)
_ = Debug.log "result" result
in
text "done"