[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
    static member Empty : 'a list
    member Head : 'a
    member IsEmpty : bool
    member Item : int -> 'a with get
    member Length : int
    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
The module 'List' contains additional values and functions related to this type.
member Item : int -> 'a with get
Get the element of the list at the given position. Note lists are represented as linked lists so this is an O(n) operation.
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
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.6.0, generated using F# Programming Language version 1.9.6.0