Options
All
  • Public
  • Public/Protected
  • All
Menu

External module "node_modules/fp-ts/lib/Array.d"

Index

Variables

URI

URI: "Array" = "Array"

alt

alt: function

Type declaration

    • <A>(x: A[]): function
    • Type parameters

      • A

      Parameters

      • x: A[]

      Returns function

        • (y: A[]): A[]
        • Parameters

          • y: A[]

          Returns A[]

ap

ap: function

Type declaration

    • <A, B>(fab: function[], fa: A[]): B[]
    • Type parameters

      • A

      • B

      Parameters

      • fab: function[]
      • fa: A[]

      Returns B[]

array

catOptions

catOptions: function

Filter an array of optional values, keeping only the elements which contain a value, creating a new array

Type declaration

    • Type parameters

      • A

      Parameters

      Returns A[]

chain

chain: function

Type declaration

    • <A, B>(f: function, fa: A[]): B[]
    • Type parameters

      • A

      • B

      Parameters

      • f: function
          • (a: A): B[]
          • Parameters

            • a: A

            Returns B[]

      • fa: A[]

      Returns B[]

concat

concat: function

Type declaration

    • <A>(x: A[]): function
    • Type parameters

      • A

      Parameters

      • x: A[]

      Returns function

        • (y: A[]): A[]
        • Parameters

          • y: A[]

          Returns A[]

cons

cons: function

Attaches an element to the front of an array, creating a new array

Type declaration

    • <A>(a: A): function
    • Type parameters

      • A

      Parameters

      • a: A

      Returns function

        • (as: A[]): A[]
        • Parameters

          • as: A[]

          Returns A[]

copy

copy: function

Type declaration

    • <A>(as: A[]): A[]
    • Type parameters

      • A

      Parameters

      • as: A[]

      Returns A[]

deleteAt

deleteAt: function

Delete the element at the specified index, creating a new array, or returning None if the index is out of bounds

Type declaration

    • (i: number): function
    • Parameters

      • i: number

      Returns function

        • Type parameters

          • A

          Parameters

          • as: A[]

          Returns Option<A[]>

drop

drop: function

Drop a number of elements from the start of an array, creating a new array

Type declaration

    • (n: number): function
    • Parameters

      • n: number

      Returns function

        • <A>(as: A[]): A[]
        • Type parameters

          • A

          Parameters

          • as: A[]

          Returns A[]

dropWhile

dropWhile: function

Remove the longest initial subarray for which all element satisfy the specified predicate, creating a new array

Type declaration

    • Type parameters

      • A

      Parameters

      Returns function

        • (as: A[]): A[]
        • Parameters

          • as: A[]

          Returns A[]

empty

empty: Lazy<Array<any>>

extend

extend: function

Type declaration

    • <A, B>(f: function, fa: A[]): B[]
    • Type parameters

      • A

      • B

      Parameters

      • f: function
          • (fa: A[]): B
          • Parameters

            • fa: A[]

            Returns B

      • fa: A[]

      Returns B[]

filter

filter: function

Filter an array, keeping the elements which satisfy a predicate function, creating a new array

Type declaration

    • Type parameters

      • A

      Parameters

      Returns function

        • (as: A[]): A[]
        • Parameters

          • as: A[]

          Returns A[]

findFirst

findFirst: function

Find the first element which satisfies a predicate function

Type declaration

    • Type parameters

      • A

      Parameters

      Returns function

findIndex

findIndex: function

Find the first index for which a predicate holds

Type declaration

    • Type parameters

      • A

      Parameters

      Returns function

        • Parameters

          • as: A[]

          Returns Option<number>

findLast

findLast: function

Find the last element which satisfies a predicate function

Type declaration

    • Type parameters

      • A

      Parameters

      Returns function

fold

fold: function

Break an array into its first element and remaining elements

Type declaration

    • <A, B>(nil: Lazy<B>, cons: function, as: A[]): B
    • Type parameters

      • A

      • B

      Parameters

      • nil: Lazy<B>
      • cons: function
          • (head: A, tail: A[]): B
          • Parameters

            • head: A
            • tail: A[]

            Returns B

      • as: A[]

      Returns B

head

head: function

Get the first element in an array, or None if the array is empty

Type declaration

    • Type parameters

      • A

      Parameters

      • as: A[]

      Returns Option<A>

index

index: function

This function provides a safe way to read a value at a particular index from an array

Type declaration

    • (i: number): function
    • Parameters

      • i: number

      Returns function

        • Type parameters

          • A

          Parameters

          • as: A[]

          Returns Option<A>

init

init: function

Get all but the last element of an array, creating a new array, or None if the array is empty

Type declaration

    • Type parameters

      • A

      Parameters

      • as: A[]

      Returns Option<A[]>

insertAt

insertAt: function

Insert an element at the specified index, creating a new array, or returning None if the index is out of bounds

Type declaration

    • (i: number): function
    • Parameters

      • i: number

      Returns function

        • <A>(a: A): function
        • Type parameters

          • A

          Parameters

          • a: A

          Returns function

            • Parameters

              • as: A[]

              Returns Option<A[]>

isEmpty

isEmpty: function

Test whether an array is empty

Type declaration

    • <A>(as: A[]): boolean
    • Type parameters

      • A

      Parameters

      • as: A[]

      Returns boolean

isOutOfBound

isOutOfBound: function

Test whether an array contains a particular index

Type declaration

    • (i: number): function
    • Parameters

      • i: number

      Returns function

        • <A>(as: A[]): boolean
        • Type parameters

          • A

          Parameters

          • as: A[]

          Returns boolean

last

last: function

Get the last element in an array, or None if the array is empty

Type declaration

    • Type parameters

      • A

      Parameters

      • as: A[]

      Returns Option<A>

length

length: function

Get the number of elements in an array

Type declaration

    • <A>(as: A[]): number
    • Type parameters

      • A

      Parameters

      • as: A[]

      Returns number

map

map: function

Type declaration

    • <A, B>(f: function, fa: A[]): B[]
    • Type parameters

      • A

      • B

      Parameters

      • f: function
          • (a: A): B
          • Parameters

            • a: A

            Returns B

      • fa: A[]

      Returns B[]

mapOption

mapOption: function

Apply a function to each element in an array, keeping only the results which contain a value, creating a new array

Type declaration

    • <A, B>(f: function): function
    • Type parameters

      • A

      • B

      Parameters

      • f: function

      Returns function

        • (as: A[]): B[]
        • Parameters

          • as: A[]

          Returns B[]

modifyAt

modifyAt: function

Apply a function to the element at the specified index, creating a new array, or returning None if the index is out of bounds

Type declaration

    • (i: number): function
    • Parameters

      • i: number

      Returns function

of

of: function

Type declaration

    • <A>(a: A): A[]
    • Type parameters

      • A

      Parameters

      • a: A

      Returns A[]

partitionMap

partitionMap: function

Type declaration

    • <A, L, R>(f: function, fa: A[]): object
    • Type parameters

      • A

      • L

      • R

      Parameters

      • f: function
      • fa: A[]

      Returns object

reduce

reduce: function

Type declaration

    • <A, B>(f: function, b: B, fa: A[]): B
    • Type parameters

      • A

      • B

      Parameters

      • f: function
          • (b: B, a: A): B
          • Parameters

            • b: B
            • a: A

            Returns B

      • b: B
      • fa: A[]

      Returns B

refine

refine: function

Type declaration

    • <A>(as: A[]): function
    • Type parameters

      • A

      Parameters

      • as: A[]

      Returns function

        • Type parameters

          • B: A

          Parameters

          Returns B[]

reverse

reverse: function

Reverse an array, creating a new array

Type declaration

    • <A>(as: A[]): A[]
    • Type parameters

      • A

      Parameters

      • as: A[]

      Returns A[]

slice

slice: function

Extract a subarray by a start and end index

Type declaration

    • (start: number, end: number): function
    • Parameters

      • start: number
      • end: number

      Returns function

        • <A>(as: A[]): A[]
        • Type parameters

          • A

          Parameters

          • as: A[]

          Returns A[]

snoc

snoc: function

Append an element to the end of an array, creating a new array

Type declaration

    • <A>(as: A[]): function
    • Type parameters

      • A

      Parameters

      • as: A[]

      Returns function

        • (a: A): A[]
        • Parameters

          • a: A

          Returns A[]

sort

sort: function

Sort the elements of an array in increasing order, creating a new array

Type declaration

    • <A>(ord: Ord<A>): function
    • Type parameters

      • A

      Parameters

      Returns function

        • (as: A[]): A[]
        • Parameters

          • as: A[]

          Returns A[]

span

span: function

Split an array into two parts:

  1. the longest initial subarray for which all elements satisfy the specified predicate
  2. the remaining elements

Type declaration

    • Type parameters

      • A

      Parameters

      Returns function

        • (as: A[]): object
        • Parameters

          • as: A[]

          Returns object

tail

tail: function

Get all but the first element of an array, creating a new array, or None if the array is empty

Type declaration

    • Type parameters

      • A

      Parameters

      • as: A[]

      Returns Option<A[]>

take

take: function

Keep only a number of elements from the start of an array, creating a new array

Type declaration

    • (n: number): function
    • Parameters

      • n: number

      Returns function

        • <A>(as: A[]): A[]
        • Type parameters

          • A

          Parameters

          • as: A[]

          Returns A[]

takeWhile

takeWhile: function

Calculate the longest initial subarray for which all element satisfy the specified predicate, creating a new array

Type declaration

    • Type parameters

      • A

      Parameters

      Returns function

        • (as: A[]): A[]
        • Parameters

          • as: A[]

          Returns A[]

traverse

traverse: traverse

unfoldr

unfoldr: function

Type declaration

    • <A, B>(f: function, b: B): A[]
    • Type parameters

      • A

      • B

      Parameters

      • f: function
          • Parameters

            • b: B

            Returns Option<[A, B]>

      • b: B

      Returns A[]

unsafeDeleteAt

unsafeDeleteAt: function

Type declaration

    • (i: number): function
    • Parameters

      • i: number

      Returns function

        • <A>(as: A[]): A[]
        • Type parameters

          • A

          Parameters

          • as: A[]

          Returns A[]

unsafeInsertAt

unsafeInsertAt: function

Type declaration

    • (i: number): function
    • Parameters

      • i: number

      Returns function

        • <A>(a: A): function
        • Type parameters

          • A

          Parameters

          • a: A

          Returns function

            • (as: A[]): A[]
            • Parameters

              • as: A[]

              Returns A[]

unsafeUpdateAt

unsafeUpdateAt: function

Type declaration

    • (i: number): function
    • Parameters

      • i: number

      Returns function

        • <A>(a: A): function
        • Type parameters

          • A

          Parameters

          • a: A

          Returns function

            • (as: A[]): A[]
            • Parameters

              • as: A[]

              Returns A[]

updateAt

updateAt: function

Change the element at the specified index, creating a new array, or returning None if the index is out of bounds

Type declaration

    • (i: number): function
    • Parameters

      • i: number

      Returns function

        • <A>(a: A): function
        • Type parameters

          • A

          Parameters

          • a: A

          Returns function

            • Parameters

              • as: A[]

              Returns Option<A[]>

wilt

wilt: function

Type declaration

    • Type parameters

      • M

      Parameters

      Returns function

        • <A, L, R>(f: function, ta: A[]): HKT<M, object>
        • Type parameters

          • A

          • L

          • R

          Parameters

          • f: function
          • ta: A[]

          Returns HKT<M, object>

zero

zero: Lazy<any[]>

zip

zip: function

Takes two arrays and returns an array of corresponding pairs. If one input array is short, excess elements of the longer array are discarded

Type declaration

    • <A>(fa: A[]): function
    • Type parameters

      • A

      Parameters

      • fa: A[]

      Returns function

        • <B>(fb: B[]): [A, B][]
        • Type parameters

          • B

          Parameters

          • fb: B[]

          Returns [A, B][]

zipWith

zipWith: function

Apply a function to pairs of elements at the same index in two arrays, collecting the results in a new array. If one input array is short, excess elements of the longer array are discarded.

Type declaration

    • <A, B, C>(f: function): function
    • Type parameters

      • A

      • B

      • C

      Parameters

      • f: function
          • (a: A, b: B): C
          • Parameters

            • a: A
            • b: B

            Returns C

      Returns function

        • (fa: A[]): function
        • Parameters

          • fa: A[]

          Returns function

            • (fb: B[]): C[]
            • Parameters

              • fb: B[]

              Returns C[]

Generated using TypeDoc