I study functional programming and use Ocaml, but I have a problem with functions.
In any case, I have a tuple, and I want to return its first value. (Very easy to know, sorry)
let bach (x,y):(float*float) = (x,y);; val bach : float * float -> float * float = <fun>
Everything is good and good here.
let john (x,y):(float*float) = y;; val john : 'a * (float * float) -> float * float = <fun>
Now this is what bothers me. Why is there 'a ? I know that this means a variable with an unknown type, but I'm confused about how adding the return value is added.
I myself proclaimed n00b in functional programming, please do not eat me :)
functional-programming ocaml
Secret
source share