DEV Community

Discussion on: Computing permutations of a list in F#

Collapse
 
arlorean profile image
Adam Davidson

This is brilliant. Thanks for sharing it. Can I ask why you used the keyword function in the parameter to List.map? There is no pattern matching going on here and it seems that fun would have done the same job, or am I missing something?

List.map (function xs' -> x::xs')

vs

List.map (fun xs' -> x::xs')

Collapse
 
ducaale profile image
Mohamed Dahir

I didn't notice that until now, thanks for catching the error. It is now fixed.

Collapse
 
arlorean profile image
Adam Davidson

Thanks Mohamed. I didn't see it as an error, I wondered if I was going to learn something new about F#. I'm still getting to grips with it myself.