Subject line says it all...
theAnswer : {} -> U8
theAnswer = \{} -> 42
expect theAnswer {} == 42
The {}
is a unit or empty value.
The function with no arguments is essentially like a value. As Luke said, you can use a unit, i.e. empty value, but since Roc is a pure functional language, it does not make much of a difference comparing to simple values.
Last updated: Jul 06 2025 at 12:14 UTC