Share via


Collections.List<'T> 공용 구조체(F#)

변경 불가능한 단일 연결 목록의 형식입니다.

네임스페이스/모듈 경로: Microsoft.FSharp.Collections

어셈블리: FSharp.Core(FSharp.Core.dll)

[<DefaultAugmentation(false)>]
[<StructuralEquality>]
[<StructuralComparison>]
type List<'T> =
| ( [] )
| ( :: ) of 'T * 'T list
 with
  interface IStructuralEquatable
  interface IComparable
  interface IComparable
  interface IStructuralComparable
  interface IEnumerable
  interface IEnumerable
  static member List.Cons : 'T * 'T list -> 'T list
  static member List.Empty :  'T list
  member this.Head :  'T
  member this.IsEmpty :  bool
  member this.Item (int) :  'T
  member this.Length :  int
  member this.Tail :  'T list
 end

설명

[] 및 ::(infix) 생성자를 사용하여 이 형식의 값을 만들거나, [1;2;3] 표기법을 사용합니다. List 모듈의 값을 사용하여 이 형식의 값을 조작하거나 값에 대한 패턴 일치를 직접 조작할 수 있습니다.

.NET 어셈블리에서 이 형식의 이름은 FSharpList입니다. F# 이외의 .NET 언어에서 형식에 액세스하거나 리플렉션을 통해 형식에 액세스하는 경우 이 이름을 사용합니다.

인스턴스 멤버

멤버

설명

Head

목록의 첫 번째 요소를 가져옵니다.

IsEmpty

목록에 항목이 없는지 여부를 나타내는 값을 가져옵니다.

항목

목록의 지정된 위치에서 요소를 가져옵니다.

길이

목록에 들어 있는 항목 수를 가져옵니다.

Tail

목록의 꼬리 부분, 즉 목록의 첫 번째 요소를 제외한 모든 요소가 들어 있는 목록을 가져옵니다.

정적 멤버

멤버

설명

Cons

첫 번째 인수인 목록을 첫 번째 요소로 반환하고 두 번째 인수는 후속 요소로 반환합니다.

비어 있음

특정 형식의 빈 목록을 반환합니다.

공용 구조체 케이스

Case

설명

( :: ) of 'T * 'T list

cons 연산자입니다.

( [] )

빈 목록입니다.

플랫폼

Windows 7, Windows Vista SP2, Windows XP SP3, Windows XP x64 SP2, Windows Server 2008 R2, Windows Server 2008 SP2, Windows Server 2003 SP2

버전 정보

F# 런타임

지원되는 버전: 2.0, 4.0

Silverlight

지원되는 버전: 3

참고 항목

참조

Microsoft.FSharp.Collections 네임스페이스(F#)

Collections.List 모듈(F#)