6.9 FParsec.ErrorMessageList

Represents a list of error messages.

6.9.1 Interface

// FParsecCS.dll

namespace FParsec

[<Sealed; AllowNullLiteral>]
type ErrorMessageList =
  member Head: ErrorMessage
  member Tail: ErrorMessageList

  new: head: ErrorMessage -> ErrorMessageList
  new: head: ErrorMessage * tail: ErrorMessageList -> ErrorMessageList
  new: head: ErrorMessage * tailMessage: ErrorMessage -> ErrorMessageList

  static member Merge: ErrorMessageList * ErrorMessageList -> ErrorMessageList
  static member ToHashSet: ErrorMessageList -> HashSet<ErrorMessage>
  static member ToSortedArray: ErrorMessageList -> ErrorMessage[]

  override Equals: obj -> bool
  override GetHashCode: unit -> int
  interface System.IEquatable<ErrorMessageList>

6.9.2 Remarks

The ErrorMessageList represents a list of error messages in which the order of the messages carries no meaning and any duplicates and empty messages are ignored. Essentially, an ErrorMessageList is constructed as a singly‐linked list, but used as a set.

A null value represents an empty ErrorMessageList.

The ErrorMessage values in an ErrorMessageList are usually all associated with the same input stream position and user state. For example, the error messages returned by a parser in a Reply value describe an error at the CharStream position that is current when the parser returns.

In order to enforce set semantics in comparison operations, the ErrorMessageList overrides the Equals and GetHashCode.

6.9.3 Members

member Head: ErrorMessage

The first ErrorMessage in this list. This property is never null.

member Tail: ErrorMessageList

The remaining ErrorMessage values in this list after the first ErrorMessage.

If there are no remaining ErrorMessage values, this property is null.

new: head: ErrorMessage -> ErrorMessageList

Constructs a new ErrorMessageList with a single ErrorMessage value.

This constructor throws a NullReferenceException if head is null.

new: head: ErrorMessage * tail: ErrorMessageList -> ErrorMessageList

Constructs a new ErrorMessageList with Head set to head and Tail set to tail.

This constructor throws a NullReferenceException if head is null.

new: head: ErrorMessage * tailMessage: ErrorMessage -> ErrorMessageList

new ErrorMessageList(head, tailmessage) is equivalent to new ErrorMessageList(head, new ErrorMessageList(tailMessage)).

static member Merge: ErrorMessageList * ErrorMessageList -> ErrorMessageList

Creates a new ErrorMessageList that contains the ErrorMessage values from both argument lists.

The order of the ErrorMessage values in the newly created list is an implementation detail that you should not depend on.

static member ToHashSet: ErrorMessageList -> HashSet<ErrorMessage>

Converts the ErrorMessageList to a HashSet<ErrorMessageList>. Duplicate error messages and empty Expected..., Unexpected... and Message messages are filtered out when the list is converted to a set.

static member ToSortedArray: ErrorMessageList -> ErrorMessage[]

Converts the ErrorMessageList to a array that is sorted by a total order. Duplicate error messages and empty Expected..., Unexpected... and Message messages are filtered out when the list is converted to the array.

The order of the sorted array is an implementation detail and may change in the future.