Results / elm-parser /
ParserMapTest
Checks that `Parser.map` transforms a parser's result: `map negate int` on `"42"` gives `Ok -42`.
Results
elm-0.19.1
passran in 80 msOutput
Compiled in DEV mode. Follow the advice at https://elm-lang.org/0.19.1/optimize for better performance and smaller assets. neg: Ok -42
elm-0.19.2
passran in 80 msOutput
Compiled in DEV mode. Follow the advice at https://elm-lang.org/0.19.2/optimize for better performance and smaller assets. neg: Ok -42
elm-0.19.3
passran in 54 msOutput
Compiled in DEV mode. Follow the advice at https://elm-lang.org/0.19.3/optimize for better performance and smaller assets. neg: Ok -42
lamdera-1.5.0
passran in 70 msOutput
neg: Ok -42
Discussions
Discuss this test·Search the discussions on GitHub
Discussions are on GitHub; one about this test has [t:elm-parser/ParserMapTest] in its title.
Source
The -- CHECK: lines give the expected output.
module ParserMapTest exposing (main)
{-| Checks that `Parser.map` transforms a parser's result: `map negate int` on `"42"` gives `Ok -42`.
-}
-- CHECK: neg: Ok -42
import Html exposing (text)
import Parser
main =
let
negInt = Parser.map negate Parser.int
result = Parser.run negInt "42"
_ = Debug.log "neg" result
in
text "done"