Reputation: 685
How to define f# function with explicit generic parameters?
I tried this one:
let my_function<'a 'b> (xs: 'a list) (ys: 'b list) = ....
but it does not work.
Upvotes: 0
Views: 164
Reputation: 80734
You're missing a comma inside the angle brackets:
let my_function<'a, 'b> (xs: 'a list) (ys: 'b list) = ....
But you don't actually have to declare your generic parameters. You can just start using them:
let my_function (xs: 'a list) (ys: 'b list) = ....
Upvotes: 5