The general form for a function type in Unison isI ->{A} O
,whereI
is the input type of the function,O
is the output type, andA
is the set ofability requirementsof the function. More generally, this can be any comma-separated list of types, likeI ->{A1,A2,A3} O
.
A function type in Unison likeA -> B
is really syntactic sugar for a typeA ->{e} B
wheree
is some set of abilities, possibly empty. A function that definitely requires no abilities has a type likeA ->{} B
(it has an empty set of abilities).