Skip to content

Question about Parameter Syntax and Function Types #3712

Answered by mtzguido
Arthri asked this question in Q&A
Discussion options

You must be logged in to vote

Hi Arthri, they do.

F* functions always unary (take a single argument) and may possibly return another function, like in most functional languages. All three examples define a "two argument" function (i.e. a function returning a function). The second case is just syntactic sugar for the first case, this syntax only helps avoid repeating the int type.

In the third case, instead of placing the binders of the left of the equal sign, h is defined directly as a lambda term. But the first and second declaration should also desugar to the same thing.

Internally, there is actually a very tiny difference between f/g and h. In the first two the body has an extra int ascription, but this should not …

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@Arthri
Comment options

Answer selected by Arthri
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants