Fix.EnumSourceThis module offers a few functions that help deal with enumerations.
A value of type 'a enum is (a description of, or a producer of) a finite sequence of elements of type 'a.
enum iter converts the function iter into an enumeration.
foreach converts an enumeration to an iter function. Thus, a loop over an enumeration xs is written foreach xs (fun x -> ...).
length xs computes and returns the length of the enumeration xs. It runs in linear time. The enumeration xs must be persistent.
The enumeration cons x xs begins with x, followed with the elements of the enumeration xs.
array xs is an enumeration of the elements of the array xs, from left to right. The array is read only when the elements of the enumeration are demanded.
enum_to_list xs demands the elements of the enumeration xs and returns a list of these elements. The elements appear in the list in the order of their production: that is, the first element of the list is the first element that was produced.
enum_to_reversed_list xs demands the elements of the enumeration xs and returns a list of these elements. The elements appear in the list in the reverse order of their production: that is, the first element of the list is the last element that was produced.
enum_to_array xs demands the elements of the enumeration xs and returns a (fresh) array of these elements. The elements appear in the array in the order of their production: that is, the first element of the array is the first element that was produced.
enum_to_reversed_array xs demands the elements of the enumeration xs and returns a (fresh) array of these elements. The elements appear in the array in the reverse order of their production: that is, the first element of the array is the last element that was produced.
filter f xs is an enumeration of the elements x, where x ranges over xs and f x is true.