Skip to content

Separation of Function Type Declaration and Definition #942

Answered by dougalm
pharringtonp19 asked this question in Q&A
Discussion options

You must be logged in to vote

No, you have to write either f : Float32 -> Float32 = \x. x * x or, more conventionally, use the def syntax, def (x:Float32) : Float32 = x * x. The latter is just syntactic sugar for the former. I never much liked the Haskell style because you have to write the function's name twice.

Replies: 1 comment 1 reply

Comment options

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

Answer selected by pharringtonp19
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