Am I missing something here? Having trouble using the Result
builtin inside the Json
builtin. Could this be because i'm working inside a builtin?
# Test json array decode empty list
expect
input = Str.toUtf8 "[ ]"
actual : Result (List U8) _
actual = Decode.fromBytes input fromUtf8
expected = Ok []
actual == expected
luke$ roc test Json.roc
── UNRECOGNIZED NAME ──────────────────────────────────────────────── Json.roc ─
Nothing is named `Result` in this scope.
514│ actual : Result (List U8) _
^^^^^^^^^^^^^^^^^^
Did you mean one of these?
List
input
Dec
actual
Actually... I needed to add Result.{ Result }
to imports... I guess for some reason I had in my mind that builtins were automatically imported.
Yeah, for builtin files, like Json.roc
, imports have to be explicit.
that shouldn't be necessary once Json
is broken out into a separate package
Last updated: Jul 05 2025 at 12:14 UTC