|
|
|
|
|
by Miky
2922 days ago
|
|
In both Gluon and Haskell, functions without arguments can be represented as functions over the unit type: f: () -> SomeType
which can be called via: f ()
There are examples of this in the Gluon book (http://gluon-lang.org/book/syntax-and-semantics.html). There are no syntax-related difficulties at all here. This is also how it's done in OCaml and related languages.(Note: This is (basically) useless in Haskell, since laziness makes this have the same semantics as a constant: f :: SomeType
But since Gluon is strict, there's a pretty important difference between the two.) |
|