Closed ghallak closed 2 years ago
That's expected. (unit) => 'a
and () => 'a
are different. The first is a function with one argument and the second a function with zero arguments. If you want to keep f2
as it is you have to change y
to datatype y('a) = Y(() => 'a)
The following code shows an error unless
function f() : int
is changed tofunction f(_ : unit) : int
: