????????????? ?????????????
F#
F# logomark
|
|
???????????
| Multi-paradigm
:
functional
,
imperative
,
object-oriented
,
agent-oriented
,
metaprogramming
,
reflective
,
concurrent
|
---|
??????
| ML
|
---|
?????????
| Don Syme
,
Microsoft Research
|
---|
????????
| Microsoft
,
The F# Software Foundation
|
---|
??????????
| 2005
; 19 ?????????
(
2005
)
, version 1.0
|
---|
|
??????????
| 16.8
[1]
/ 10 ????????? 2020
; 3 ??????
(
10 ????????? 2020
)
|
---|
|
??????????????
| Static
,
strong
,
inferred
|
---|
??????????????
| Cross-platform
:
.NET
,
.NET Framework
,
Mono
|
---|
???????????
| MIT License
[2]
[3]
|
---|
??????????????
| .fs, .fsi, .fsx, .fsscript
|
---|
????????
| fsharp
.org
|
---|
????????????????
|
---|
C#
,
Erlang
,
Haskell
,
[4]
ML
,
OCaml
,
[5]
[6]
Python
,
Scala
|
?????????????
|
---|
C#
,
[7]
Elm
,
F*
,
LiveScript
|
|
????????????
(F#) ????????????????????????????????????????
strongly typed
??
?????????????????
???
Mono
???????????
????????????????????
??????????????
???????????????????????????
????????????????????????
???
?????????????????????????
F# ????
???????????
??????????????
??????
?????????? ?????????????????????????????? ?????????? F# ??????????????????
?????????????????????
[8]
??????????????????
?????????????????????
????
GPU
[9]
????????????????????????
????????????
[10]
???????
[11]
???
?????????
[12]
??????
Programming tool
??????????????
Xamarin
???????
[
???
]
F# ????????????????
Don Syme
??????
[13]
??? Microsoft Research
[14]
?????????????????????
OCaml
(????????????????????????
ML
)
??????????????????????????
??????????
[15]
???????????
F# Software Foundation
,
Microsoft
, ??????????????????
??????
[
???
]
F# ??????????? strongly typed ?????????????????????????????????????? ?????????????????????????????????? ???????????????????????? ???????????????????????????? ???????????????????????????? control flows ?? F# ????
expression
????? type ????
???????????????
????????????????????????????
?????????????????????????????? F# ??????:
- Unit ????????????
Void
????????????????
C
- Tuple
- Record
- Discriminated unions
- List
- Option
???????????????
[
???
]
????????? Factorial
[
???
]
> let rec fact = function
| 0 -> 1
| n -> n * fact(n-1);;
val fact : int -> int
???????
> fact 12;;
val it : int = 479001600
?????????????
[
???
]
open System.Windows.Forms
let form = new Form()
do form.Visible <- true
do form.TopMost <- true
do form.Text <- "Welcome to F#"
let x = 3 + (4 * 5)
do form.Text <- (if x = 23 then "Correct!" else "incorrect")
???????
[
???
]
???????
[
???
]
???????????????
[
???
]