Elm Exactly
Results / elm-parser /

ParserAdvancedRunTest

elm-0.19.1 passelm-0.19.2 passelm-0.19.3 passlamdera-1.5.0 pass
`Parser.Advanced.run` returns the value of a parser that succeeds without consuming input.

`succeed 42` is run on the empty string and the result is `Ok 42`.

Results

elm-0.19.1

passran in 57 ms
Output
Compiled in DEV mode. Follow the advice at https://elm-lang.org/0.19.1/optimize for better performance and smaller assets.
succeeded: Ok 42

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.
succeeded: Ok 42

elm-0.19.3

passran in 61 ms
Output
Compiled in DEV mode. Follow the advice at https://elm-lang.org/0.19.3/optimize for better performance and smaller assets.
succeeded: Ok 42

lamdera-1.5.0

passran in 67 ms
Output
succeeded: Ok 42

Discussions

Discuss this test·Search the discussions on GitHub

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

Source

The -- CHECK: lines give the expected output.

module ParserAdvancedRunTest exposing (main)
{-| `Parser.Advanced.run` returns the value of a parser that succeeds without consuming input.
`succeed 42` is run on the empty string and the result is `Ok 42`.
-}
-- CHECK: succeeded: Ok 42
import Html exposing (text)
import Parser.Advanced as PA
p : PA.Parser c pr Int
p =
PA.succeed 42
main =
let
result = PA.run p ""
_ = Debug.log "succeeded" result
in
text "done"