The general form for a function type in Unison is I ->{A} O
, where I
is the input type of the function, O
is the output type, and A
is the set of ability requirements of the function. More generally, this can be any comma-separated list of types, like I ->{A1,A2,A3} O
.
A function type in Unison like A -> B
is really syntactic sugar for a type A ->{e} B
where e
is some set of abilities, possibly empty. A function that definitely requires no abilities has a type like A ->{} B
(it has an empty set of abilities).