FSharp-05-Match_and_if_then
if then else
fsharp
1 | // define |
fsharp
1 | let g x = |
练习:
string -> int
“one” -> 1
“two” -> 2
“three” -> 3
_ -> 0
match with
fsharp
1 | let f x = |
fsharp
1 | let g x = |
fsharp
1 | let h x = |
fsharp
1 | let compare x y = |
练习
h: a: int -> b: int -> unint
h: a: int * b: int -> unit
if a is odd then print “a = b + c”
if a is even then print “a = b - c”
fsharp
1 | let g x = |
All articles in this blog are licensed under CC BY-NC-SA 4.0 unless stating additionally.
Comment
Powered By Valine
v1.5.2
v1.5.2