[Home] Type Microsoft.FSharp.Collections.List


The type of immutable singly-linked lists. Use the constructors [] and '::' (infix) to create values of this type, or the notation [1;2;3]. Use the values in the [[List]] module to manipulate values of this type, or pattern match against the values directly.

Full Type Signature

type List<'a> =
  | ( [] )
  | ( :: ) of 'a * 'a list
  with
    interface IEnumerable
    interface IEnumerable<'a>
    static member Cons : 'a * 'a list -> 'a list
    [<Obsolete
      ("This member is being deprecated in order to 'reduce the number of ways of doing the same thing' in the F# Library. Use 'List.exists' instead, and replace the use of dot-notation with a use of the '|>' pipe operator")>]
    member Exists : ('a -> bool) -> bool
    [<Obsolete
      ("This member is being deprecated in order to 'reduce the number of ways of doing the same thing' in the F# Library. Use 'List.filter' instead, and replace the use of dot-notation with a use of the '|>' pipe operator")>]
    member Filter : ('a -> bool) -> 'a list
    [<Obsolete
      ("This member is being deprecated in order to 'reduce the number of ways of doing the same thing' in the F# Library. Use 'List.for_all' instead, and replace the use of dot-notation with a use of the '|>' pipe operator")>]
    member ForAll : ('a -> bool) -> bool
    [<Obsolete
      ("This member is being deprecated in order to 'reduce the number of ways of doing the same thing' in the F# Library. Use 'List.iter' instead, and replace the use of dot-notation with a use of the '|>' pipe operator")>]
    member Iterate : ('a -> unit) -> unit
    [<Obsolete
      ("This member is being deprecated in order to 'reduce the number of ways of doing the same thing' in the F# Library. Use 'List.iteri' instead, and replace the use of dot-notation with a use of the '|>' pipe operator")>]
    member IterateIndexed : (int -> 'a -> unit) -> unit
    [<Obsolete
      ("This member is being deprecated in order to 'reduce the number of ways of doing the same thing' in the F# Library. Use 'List.map' instead, and replace the use of dot-notation with a use of the '|>' pipe operator")>]
    member Map : ('a -> 'b) -> 'b list
    [<Obsolete
      ("This member is being deprecated in order to 'reduce the number of ways of doing the same thing' in the F# Library. Use 'List.mapi' instead, and replace the use of dot-notation with a use of the '|>' pipe operator")>]
    member MapIndexed : (int -> 'a -> 'b) -> 'b list
    [<Obsolete
      ("This member is being deprecated in order to 'reduce the number of ways of doing the same thing' in the F# Library. Use 'List.rev' instead, and replace the use of dot-notation with a use of the '|>' pipe operator")>]
    member Reverse : unit -> 'a list
    static member Empty : 'a list
    member Head : 'a
    [<Obsolete ("This member is deprecated. Use 'not list.IsEmpty' instead")>]
    member IsCons : bool
    member IsEmpty : bool
    [<Obsolete ("This member is deprecated. Use 'IsEmpty' instead")>]
    member IsNil : bool
    member Length : int
    [<Obsolete ("This member is deprecated. Use 'List.Empty' instead")>]
    static member Nil : 'a list
    member Tail : 'a list
  end

Instance Members

MemberDescription
member Head : 'a
The module 'List' contains additional values and functions related to this type, e.g. List.fold_left, List.append etc.
member IsEmpty : bool
member Length : int
The module 'List' contains additional values and functions related to this type.
member Tail : 'a list
The module 'List' contains additional values and functions related to this type.

Static Members

MemberDescription
member Cons : 'a * 'a list -> 'a list
The module 'List' contains additional values and functions related to this type.
member Empty : 'a list

Deprecated Members

MemberDescription
[<Obsolete
  ("This member is being deprecated in order to 'reduce the number of ways of doing the same thing' in the F# Library. Use 'List.exists' instead, and replace the use of dot-notation with a use of the '|>' pipe operator")>]
member Exists : ('a -> bool) -> bool

Note: This member is being deprecated in order to 'reduce the number of ways of doing the same thing' in the F# Library. Use 'List.exists' instead, and replace the use of dot-notation with a use of the '|>' pipe operator

Test if any element of the collection satisfies the given predicate. See also List.exists. The module 'List' contains additional values and functions related to this type.
[<Obsolete
  ("This member is being deprecated in order to 'reduce the number of ways of doing the same thing' in the F# Library. Use 'List.filter' instead, and replace the use of dot-notation with a use of the '|>' pipe operator")>]
member Filter : ('a -> bool) -> 'a list

Note: This member is being deprecated in order to 'reduce the number of ways of doing the same thing' in the F# Library. Use 'List.filter' instead, and replace the use of dot-notation with a use of the '|>' pipe operator

Return a new collection containing only the elements of the collection for which the given predicate returns "true" See also List.filter. The module 'List' contains additional values and functions related to this type.
[<Obsolete
  ("This member is being deprecated in order to 'reduce the number of ways of doing the same thing' in the F# Library. Use 'List.for_all' instead, and replace the use of dot-notation with a use of the '|>' pipe operator")>]
member ForAll : ('a -> bool) -> bool

Note: This member is being deprecated in order to 'reduce the number of ways of doing the same thing' in the F# Library. Use 'List.for_all' instead, and replace the use of dot-notation with a use of the '|>' pipe operator

Test if all elements of the collection satisfy the given predicate. See also List.for_all. The module 'List' contains additional values and functions related to this type.
[<Obsolete ("This member is deprecated. Use 'not list.IsEmpty' instead")>]
member IsCons : bool

Note: This member is deprecated. Use 'not list.IsEmpty' instead

The module 'List' contains additional values and functions related to this type.
[<Obsolete ("This member is deprecated. Use 'IsEmpty' instead")>]
member IsNil : bool

Note: This member is deprecated. Use 'IsEmpty' instead

The module 'List' contains additional values and functions related to this type.
[<Obsolete
  ("This member is being deprecated in order to 'reduce the number of ways of doing the same thing' in the F# Library. Use 'List.iter' instead, and replace the use of dot-notation with a use of the '|>' pipe operator")>]
member Iterate : ('a -> unit) -> unit

Note: This member is being deprecated in order to 'reduce the number of ways of doing the same thing' in the F# Library. Use 'List.iter' instead, and replace the use of dot-notation with a use of the '|>' pipe operator

See List.iter
[<Obsolete
  ("This member is being deprecated in order to 'reduce the number of ways of doing the same thing' in the F# Library. Use 'List.iteri' instead, and replace the use of dot-notation with a use of the '|>' pipe operator")>]
member IterateIndexed : (int -> 'a -> unit) -> unit

Note: This member is being deprecated in order to 'reduce the number of ways of doing the same thing' in the F# Library. Use 'List.iteri' instead, and replace the use of dot-notation with a use of the '|>' pipe operator

Apply the given function to each element of the collection. The integer passed to the function indicates the index of element. See also List.iteri. The module 'List' contains additional values and functions related to this type.
[<Obsolete
  ("This member is being deprecated in order to 'reduce the number of ways of doing the same thing' in the F# Library. Use 'List.map' instead, and replace the use of dot-notation with a use of the '|>' pipe operator")>]
member Map : ('a -> 'b) -> 'b list

Note: This member is being deprecated in order to 'reduce the number of ways of doing the same thing' in the F# Library. Use 'List.map' instead, and replace the use of dot-notation with a use of the '|>' pipe operator

Build a new list whose elements are the results of applying the given function See also List.map. The module 'List' contains additional values and functions related to this type.
[<Obsolete
  ("This member is being deprecated in order to 'reduce the number of ways of doing the same thing' in the F# Library. Use 'List.mapi' instead, and replace the use of dot-notation with a use of the '|>' pipe operator")>]
member MapIndexed : (int -> 'a -> 'b) -> 'b list

Note: This member is being deprecated in order to 'reduce the number of ways of doing the same thing' in the F# Library. Use 'List.mapi' instead, and replace the use of dot-notation with a use of the '|>' pipe operator

Build a new collection whose elements are the results of applying the given function to each of the elements of the collection. The integer index passed to the function indicates the index (from 0) of element being transformed. See also List.map. The module 'List' contains additional values and functions related to this type.
[<Obsolete ("This member is deprecated. Use 'List.Empty' instead")>]
member Nil : 'a list

Note: This member is deprecated. Use 'List.Empty' instead

The module 'List' contains additional values and functions related to this type.
[<Obsolete
  ("This member is being deprecated in order to 'reduce the number of ways of doing the same thing' in the F# Library. Use 'List.rev' instead, and replace the use of dot-notation with a use of the '|>' pipe operator")>]
member Reverse : unit -> 'a list

Note: This member is being deprecated in order to 'reduce the number of ways of doing the same thing' in the F# Library. Use 'List.rev' instead, and replace the use of dot-notation with a use of the '|>' pipe operator

Return a new list with the elements in reverse order See also List.rev. The module 'List' contains additional values and functions related to this type.

See Also

Microsoft.FSharp.Collections


Documentation for assembly FSharp.Core, version 1.9.4.19, generated using F# version 1.9.4.19