F# explicit match vs function syntax

后端 未结 8 2479
耶瑟儿~
耶瑟儿~ 2020-12-04 23:21

Sorry about the vague title, but part of this question is what these two syntax styles are called:

let foo1 x = 
    match x with
    | 1 -> \"one\"
    |         


        
8条回答
  •  没有蜡笔的小新
    2020-12-04 23:32

    The two syntaxes are equivalent. Most programmers choose one or the other and then use it consistently.

    The first syntax remains more readable when the function accepts several arguments before starting to work.

提交回复
热议问题