FunctionalObjectiveC
示例
NSArray *numbers = @[@1, @2, @3, @4];
NSNumber *sum = F.reduce [F.add] [@0] [numbers];
XCTAssertEqualObjects(sum, @10);
需求
安装
FunctionalObjectiveC 可通过 CocoaPods 获得。要安装它,只需在 Podfile 中添加以下行:
pod 'FunctionalObjectiveC'
检查列表
常量
- 始终
- 真
- 假
算术运算
- 加
- 减
- 乘
- 除
- 取模
- 取反
- 递增
- 递减
数学函数
- acos
- asin
- atan
- atan2
- cos
- sin
- tan
- acosh
- asinh
- atanh
- cosh
- sinh
- tanh
- exp
- exp2
- expm1
- log
- log10
- log2
- log1p
- logb
- modf
- ldexp
- frexp
- ilogb
- scalbn
- fabs
- cbrt
- hypot
- pow
- sqrt
- erf
- erfc
- lgamma
- tagmma
- ceil
- floor
- nearbyint
- rint
- lrint
- round
- lround
- llrint
- llround
- trunc
- fmod
- remainder
- remquo
- copysign
- nan
- nextafter
- nexttoward
- fdim
- fmax
- fmin
- fma
比较运算
- eq
- neq
- gt
- gte
- lt
- lte
- max
- min
逻辑运算
- 非
- 无
- 补码
- 与
- 两者
- 所有
- 所有通过
- 或
- 任一
- 任何
- 任何通过
字符
- isControl
- isSpace
- isLower
- isUpper
- isAlpha
- isAlphaNum
- isPrint
- isDigit
- isOctDigit
- isHexDigit
- isLetter
- isMark
- isNumber
- isPunctuation
- isSymbol
- isSeparator
- isAscii
- isLatin1
- isAsciiUpper
- isAsciiLower
- generalCategory
- toUpper
- toLower
- toTitle
- digitToInt
- intToDigit
- ord
- chr
- showLitChar
- lexLitChar
- readLitChar
字符串
- test
- match
- replace
- trim
- lines
- words
- unlines
- unwords
数组
- of
- pair
- range
- repeat
- times
- aperture
- xprod
- transpose
- uniq
- uniqBy
- uniqWith
- unnest
- zip
- zipWith
- mean
- median
- sum
- product
字典
- keys
- values
- fromPairs
- toPairs
- pick
- pickAll
- pickBy
- project
- indexBy
- groupBy
- groupWith
- merge
- mergeWith
- mergeWithKey
- mergeAll
- invert
- omit
集合
- isEmpty
- length
- empty
- map
- mapAccum
- mapAccumRight
- filter
- reject
- forEach
- contains
- reduce
- reduceRight
- reduced
- reduceBy
- reduceWhile
- scan
- chain
- 压平
- 分区
- 无
有序集合
- 第n个
- 头部
- 尾部
- 切片
- 初始
- 尾部
- 插入
- 插入所有
- 间隔
- 追加
- prepend
- 连接
- 更新
- 调整
- 移除
- 删除
- 删除While
- 删除尾部
- 删除While尾部
- 删除重复
- 根据重复项删除
- 摘取
- While摘取
- 摘取尾部
- While摘取尾部
- 分割
- 分割At
- 每几个分割
- 当分割
- 连接
- indexOf
- lastIndexOf
- find
- findIndex
- findLast
- findLastIndex
- startsWith
- endsWith
- reverse
流程控制
- when
- unless
- ifElse
- cond
- until
- defaultTo
对象
- is
- isNil
- type
- clone
- has
- prop
- props
- propIs
- propEq
- propOr
- propSatisfies
- eqProps
- path
- pathSatisfies
- assoc
- assocPath
- dissoc
- dissocPath
排序
- sort
- sortBy
- sortWith
- ascend
- descend
- maximum
- maximumBy
- minimum
- minimumBy
透镜
- lens
- lensProp
- lensPath
- lensIndex
- view
- set
- over
调试
- 打印
作者
Leon, [email protected]
许可
FunctionalObjectiveC 受 MIT 许可协议保护。更多详情请参阅 LICENSE 文件。