Stream: beginners

Topic: Program compiles without implementation


view this post on Zulip JRI98 (Dec 06 2023 at 00:49):

Quick question. Is the following program supposed to compile? Types are correct, yes, but I did not expect it to build given the lack of implementation for the function f. It is kind of surprising for it to crash at runtime when it compiled without warnings or errors.

app "hello"
    packages { pf: "https://github.com/roc-lang/basic-cli/releases/download/0.7.0/bkGby8jb0tmZYsy2hg1E_B2QrCgcSTxdUlHtETwm5m4.tar.br" }
    imports [pf.Task.{ Task }]
    provides [main] to pf

f : {} -> {}

main =
    f {}
    |> Task.ok

view this post on Zulip Brendan Hansknecht (Dec 06 2023 at 00:50):

should give a warning, but it is supposed to compile

view this post on Zulip Anton (Dec 06 2023 at 10:17):

#6203


Last updated: Jul 05 2025 at 12:14 UTC