There are some subtle enough differences that direct transpiling likely won’t work. Roc does t have custom types like Elm does, but does have union types (I think I’m saying that correctly) which kind of have a similar purpose but are used differently. Roc also doesn’t have currying, e.g. in Elm You can write
add : Int -> Int -> Int
add = (+)
increment : Int -> Int
increment = add 1
but in Roc you’d write
add : Int, Int -> Int
add = \a, b -> a + b
increment : Int -> Int
increment = \x -> add x 1
There are also differences with piping. In Elm |>
is a function, but in Roc it’s syntactic sugar.
These 2 differences mean that in Roc you typically pass the “thing you’re piping” as the first argument when in Elm it’s the last argument.