user3284063
user3284063

Reputation: 685

F# function with two generic parameters

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

Answers (1)

Fyodor Soikin
Fyodor Soikin

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

Related Questions