I see that the standard library uses empty : () -> Foo rather than empty : Foo.
Is there a rationale for that? I tend to use plain constants rather than functions with no args whenever possible, so I'm curious to know why using a function is preferred?
it's because constants can't be polymorphic
like you can't do x : List(_a)
it's a weird edge case we talked about a long time ago :sweat_smile:
Thanks @Richard Feldman .
If the function is defined at the top-level and can be evaluated at compile time, then I suppose it will produce the same binary as if I had used a constant instead (of the correct concrete type), right?
yep!
Last updated: Oct 15 2026 at 17:56 UTC