F#
2022-03-25 19:34:16 1 举报
AI智能生成
F #是一种函数式编程语言。 函数式编程把计算机程序作为数学函数。在函数式编程,重点将是对常量和函数,而不是变量和状态。由于函数和常量事情不会改变。 在函数式编程中,您将编写模块化的程序,即程序将包括将其他函数作为输入功能。
作者其他创作
大纲/内容
概述
特点
用途
制定科学模型
数学解题
人工智能
金融建模
平面设计
CPU设计
编译器编程
电信
环境配置
程序结构
基本语法
token
keywords
数据类型
整数
浮点
文本
其他
bool
变量
运算符
算术运算符
+-*/%**
比较运算符
=|<>|>| <|>=|<=
布尔运算符
&& || not
位运算符
&&& 、|||、^^^、~~~、<<<、>>>
条件
循环
函数
字符串
选项
元组
(a[,b]+)
记录
type recordName= { [filedName : dataType ;]+ }
列表
[]
序列
{}
集
set
映射(Map)
[ (filedKey, filedValue) ; ]
差别联合
type type-name =
| case-identifier1 [of [ fieldname1 : ] type1 [ * [ fieldname2 : ]
type2 ...]
| case-identifier2 [of [fieldname3 : ]type3 [ * [ fieldname4 : ]type4 ...]
...
| case-identifier1 [of [ fieldname1 : ] type1 [ * [ fieldname2 : ]
type2 ...]
| case-identifier2 [of [fieldname3 : ]type3 [ * [ fieldname4 : ]type4 ...]
...
数组
[| |]
可变列表
List<T>
可变字典
Dictionary<TKey,TValue>
变量
IO
泛型
// Explicitly generic function.
let function-name<type-parameters> parameter-list =
function-body
// Explicitly generic method.
[ static ] member object-identifer.method-name<type-parameters> parameter-list [ return-type ] =
method-body
// Explicitly generic class, record, interface, structure,
// or discriminated union.
type type-name<type-parameters> type-definition
let function-name<type-parameters> parameter-list =
function-body
// Explicitly generic method.
[ static ] member object-identifer.method-name<type-parameters> parameter-list [ return-type ] =
method-body
// Explicitly generic class, record, interface, structure,
// or discriminated union.
type type-name<type-parameters> type-definition
委托
枚举
模式匹配
异常
类
结构
运算符重载
继承
接口
// Interface declaration:
[ attributes ]
type interface-name =
[ interface ]
[ inherit base-interface-name ...]
abstract member1 : [ argument-types1 -> ] return-type1
abstract member2 : [ argument-types2 -> ] return-type2
...
[ end ]
// Implementing, inside a class type definition:
interface interface-name with
member self-identifier.member1 argument-list = method-body1
member self-identifier.member2 argument-list = method-body2
// Implementing, by using an object expression:
[ attributes ]
let class-name (argument-list) =
{ new interface-name with
member self-identifier.member1 argument-list = method-body1
member self-identifier.member2 argument-list = method-body2
[ base-interface-definitions ]
}
member-list
[ attributes ]
type interface-name =
[ interface ]
[ inherit base-interface-name ...]
abstract member1 : [ argument-types1 -> ] return-type1
abstract member2 : [ argument-types2 -> ] return-type2
...
[ end ]
// Implementing, inside a class type definition:
interface interface-name with
member self-identifier.member1 argument-list = method-body1
member self-identifier.member2 argument-list = method-body2
// Implementing, by using an object expression:
[ attributes ]
let class-name (argument-list) =
{ new interface-name with
member self-identifier.member1 argument-list = method-body1
member self-identifier.member2 argument-list = method-body2
[ base-interface-definitions ]
}
member-list
事件(event)
模块
命名空间
工作目标概述
子主题
子主题
当前现状说明
子主题
子主题
具体工作内容
子主题
子主题
工作过程评估
子主题
子主题
计划时间安排
子主题
子主题
0 条评论
下一页