Skip to content

Instantly share code, notes, and snippets.

@travisstaloch
Created October 8, 2022 07:14
Show Gist options
  • Save travisstaloch/f35ec1600f7b46c72d7cefb1b9697e6b to your computer and use it in GitHub Desktop.
Save travisstaloch/f35ec1600f7b46c72d7cefb1b9697e6b to your computer and use it in GitHub Desktop.
# create this file at <roc-repo-root>/examples/parser/repro.roc
# run
# $ cd <roc-repo-root> && roc examples/parser/repro.roc
#
app "lazy-parser-repro"
packages { pf: "platform/main.roc" }
imports [
Parser.Core.{ Parser, map, lazy},
Parser.Str.{ parseStr, RawStr }
]
provides [main] to pf
a: Parser RawStr Str
a = lazy (\{} -> b)
|> map (\_ -> "")
b: Parser RawStr Str
b = a
main: Str
main =
parseStr a ""
|> (Result.withDefault "err")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment