概述

构造集合接口


目录


ConstructorCollection (接口)

构造集合接口

签名

interface ConstructorCollection extends ConstructorCollectionInput {
  /**
   *空集合
   */
  empty(): Kind<F, any>
  /**
   *通过一个数字和函数构建集合
   */
  makeBy<A>(n: number, f: (i: number) => A): Kind<F, A>
  /**
   *通过一个范围和函数构建集合
   */
  makeByRange(start: number, end: number): Kind<F, number>
  /**
   *通过重复的元素构建集合
   */
  makeByRepeat<A>(n: number, a: A): Kind<F, A>
}

v0.2.0 中添加

ConstructorCollectionInput (接口)

构造集合输入接口

签名

interface ConstructorCollectionInput {
  readonly URI: F
  /**
   *从迭代器中构建集合
   */
  from: <A = never>(collection: Iterable<A>) => Kind<F, A>
}

v0.2.0 中添加

initConstructor (函数)

v0.2.0 中添加