Separation of Function Type Declaration and Definition #942
Answered
by
dougalm
pharringtonp19
asked this question in
Q&A
-
|
Is it possible to separate the type declaration of a function from the definition as done in Haskell? |
Beta Was this translation helpful? Give feedback.
Answered by
dougalm
Jun 6, 2022
Replies: 1 comment 1 reply
-
|
No, you have to write either |
Beta Was this translation helpful? Give feedback.
1 reply
Answer selected by
pharringtonp19
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
No, you have to write either
f : Float32 -> Float32 = \x. x * xor, more conventionally, use thedefsyntax,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.