roc/examples/ruby-interop/platform/main.roc
shua d90da3af52
rm TotallyNotJson
TotallyNotJson.roc now lives on the farm in virtual-dom-wip as Json.roc.
Any reference in stdlib or builtins has been removed, as well as the
last places it was used (in python/ruby-interop examples).
2024-07-01 20:37:23 +02:00

16 lines
420 B
Text

platform "ruby-interop"
requires {} { main : U64 -> Str }
exposes []
packages {}
imports []
provides [mainForHost]
mainForHost : List U8 -> List U8
mainForHost = \input ->
when Str.fromUtf8 input is
Ok arg ->
when Str.toU64 arg is
Ok num -> main num |> Str.toUtf8
Err _ -> []
Err _ -> [] # TODO panic so that Ruby raises an exception