(vine.dev) The Inverse - The Vine Programming Language
ROAM_REFS: https://vine.dev/docs/features/inverse
Vine's concept of the inverse is not something seen in other programming languages, as it is a concept that is only possible due to the unique properties of interaction nets.
The inverse type
~N32represents an expectation of anN32. Such an expectation must be fulfilled with anN32. The type~~N32is equivalent to the typeN32.The inverse operator can be applied to a value, a space, or a place.
- The inverse operator, when applied to a space
sof typeT, evaluates to a value of type~T. This value is the expectation of aTthat will be put into the spaces.- The inverse operator, when applied to a value
vof typeT, evaluates to a space of type~T. Whatever expectation is put into the space will be fulfilled with the valuev.- The inverse operator, when applied to a place
pof typeT, evaluates to a placeqof type~T. The value ofqis the inverse of the space ofp; the space ofqis the inverse of the value ofp.The inverse pattern is essentially the reverse of the inverse operator, and can be used to unwrap inverse types.