This a suite of very high-performance immutable-collections.
- For lists you should always prefer to use
Seq<A>
- it is about 10x faster thanLst<A>
. The only reason you'd pickLst<A>
is if you needed to do inserts into the middle of the list:Seq<A>
doesn't allow this (it only allows prepending or appending), as it would be a performance hit.Seq<A>
is backed by an array, and so it has exceptional memory locality,Lst<A>
is an AVL tree to allow for efficient
insertion, but suffers from poorer memory locality. - For 'dictionaries' or maps as we prefer to call them, then
HashMap
is the fastest implemention you'll find in .NET-land. It is unsorted. If you need a sorted dictionary, useMap
.HashMap
uses the CHAMP data-structure,Map
uses an AVL tree. - The same goes for sets, prefer
HashSet
overSet
, unless you need the set to be sorted.
You can construct the collection types using the constrctor functions in the Prelude
:
HashMap<string, int> hashSet = HashMap(("a", 1), ("b", 2), ("c", 3));
HashSet<int> hashMap = HashSet(1, 2, 3);
Map<string, int> hashSet = Map(("a", 1), ("b", 2), ("c", 3));
Set<int> hashMap = Set(1, 2, 3);
Seq<int> list = Seq(1, 2, 3);
Lst<int> list = List(1, 2, 3);
- Prelude
- Empty = new SeqEmpty()
- Cons <A> (this A head)
- Cons <A> (this A head, SeqEmpty empty)
- Cons <A> (this A head, Seq<A> tail)
- Cons <A> (this A head, A[] tail)
- Cons <A> (this A head, Arr<A> tail)
- Cons <A> (this A head, IEnumerable<A> tail)
- Cons <A> (this A head, Lst<A> tail)
- Sort <OrdA, A> (this IEnumerable<A> xs)
- Sort <OrdA, A> (this Seq<A> xs)
- Sort <OrdA, A> (this Lst<A> xs)
- Sort <OrdA, A> (this Arr<A> xs)
- Sort <OrdA, A> (this A[] xs)
- Naturals
- LongNaturals
- Range (int from, int count, int step = 1)
- Range (char from, char to)
- Range (params IEnumerable<int>[] ranges)
- Range (params IEnumerable<char>[] ranges)
- Map <K, V> ()
- Map <K, V> (Tuple<K, V> head, params Tuple<K, V>[] tail)
- Map <K, V> ((K, V) head, params (K, V)[] tail)
- Map <K, V> (KeyValuePair<K, V> head, params KeyValuePair<K, V>[] tail)
- toMap <K, V> (IEnumerable<Tuple<K, V>> items)
- toMap <K, V> (IEnumerable<(K, V)> items)
- toMap <K, V> (IEnumerable<KeyValuePair<K, V>> items)
- Map <OrdK, K, V> ()
- Map <OrdK, K, V> (Tuple<K, V> head, params Tuple<K, V>[] tail)
- Map <OrdK, K, V> ((K, V) head, params (K, V)[] tail)
- toMap <OrdK, K, V> (KeyValuePair<K, V> head, params KeyValuePair<K, V>[] tail)
- toMap <OrdK, K, V> (IEnumerable<(K, V)> items)
- toMap <OrdK, K, V> (IEnumerable<Tuple<K, V>> items)
- toMap <OrdK, K, V> (IEnumerable<KeyValuePair<K, V>> items)
- HashMap <K, V> ()
- HashMap <K, V> (Tuple<K,V> head, params Tuple<K, V>[] tail)
- HashMap <K, V> ((K, V) head, params (K, V)[] tail)
- HashMap <K, V> (KeyValuePair<K, V> head, params KeyValuePair<K, V>[] tail)
- toHashMap <K, V> (IEnumerable<(K, V)> items)
- toHashMap <K, V> (IEnumerable<Tuple<K, V>> items)
- toHashMap <K, V> (IEnumerable<KeyValuePair<K, V>> items)
- HashMap <EqK, K, V> ()
- HashMap <EqK, K, V> (Tuple<K, V> head, params Tuple<K, V>[] tail)
- HashMap <EqK, K, V> ((K, V) head, params (K, V)[] tail)
- HashMap <EqK, K, V> (KeyValuePair<K, V> head, params KeyValuePair<K, V>[] tail)
- toHashMap <EqK, K, V> (IEnumerable<Tuple<K, V>> items)
- toHashMap <EqK, K, V> (IEnumerable<(K, V)> items)
- toHashMap <EqK, K, V> (IEnumerable<KeyValuePair<K, V>> items)
- TrackingHashMap <K, V> ()
- TrackingHashMap <K, V> (Tuple<K,V> head, params Tuple<K, V>[] tail)
- TrackingHashMap <K, V> ((K, V) head, params (K, V)[] tail)
- TrackingHashMap <K, V> (KeyValuePair<K, V> head, params KeyValuePair<K, V>[] tail)
- toTrackingHashMap <K, V> (IEnumerable<(K, V)> items)
- toTrackingHashMap <K, V> (IEnumerable<Tuple<K, V>> items)
- toTrackingHashMap <K, V> (IEnumerable<KeyValuePair<K, V>> items)
- TrackingHashMap <EqK, K, V> ()
- TrackingHashMap <EqK, K, V> (Tuple<K, V> head, params Tuple<K, V>[] tail)
- TrackingHashMap <EqK, K, V> ((K, V) head, params (K, V)[] tail)
- TrackingHashMap <EqK, K, V> (KeyValuePair<K, V> head, params KeyValuePair<K, V>[] tail)
- toTrackingHashMap <EqK, K, V> (IEnumerable<Tuple<K, V>> items)
- toTrackingHashMap <EqK, K, V> (IEnumerable<(K, V)> items)
- toTrackingHashMap <EqK, K, V> (IEnumerable<KeyValuePair<K, V>> items)
- AtomHashMap <K, V> ()
- AtomHashMap <K, V> ((K, V) head, params (K, V)[] tail)
- AtomHashMap <K, V> (HashMap<K, V> items)
- AtomHashMap <K, V> (KeyValuePair<K, V> head, params KeyValuePair<K, V>[] tail)
- toAtomHashMap <K, V> (IEnumerable<(K, V)> items)
- toAtomHashMap <K, V> (IEnumerable<KeyValuePair<K, V>> items)
- AtomHashMap <EqK, K, V> ()
- AtomHashMap <EqK, K, V> ((K, V) head, params (K, V)[] tail)
- AtomHashMap <EqK, K, V> (KeyValuePair<K, V> head, params KeyValuePair<K, V>[] tail)
- AtomHashMap <EqK, K, V> (HashMap<EqK, K, V> items)
- toAtomHashMap <EqK, K, V> (IEnumerable<(K, V)> items)
- toAtomHashMap <EqK, K, V> (IEnumerable<KeyValuePair<K, V>> items)
- List <T> ()
- List <T> (T x, params T[] xs)
- toList <T> (Arr<T> items)
- toList <T> (IEnumerable<T> items)
- List <PredList, T> ()
- List <PredList, T> (T x, params T[] xs)
- toList <PredList, T> (Arr<T> items)
- toList <PredList, T> (IEnumerable<T> items)
- List <PredList, PredItem, T> ()
- List <PredList, PredItem, T> (T x, params T[] xs)
- toList <PredList, PredItem, T> (Arr<T> items)
- toList <PredList, PredItem, T> (IEnumerable<T> items)
- Array <T> ()
- Array <T> (T x, params T[] xs)
- toArray <T> (IEnumerable<T> items)
- Queue <T> ()
- Queue <T> (params T[] items)
- toQueue <T> (IEnumerable<T> items)
- Stack <T> ()
- Stack <T> (params T[] items)
- toStack <T> (IEnumerable<T> items)
- toStackRev <T> (IEnumerable<T> items)
- toMapUpdate <K, V> (IEnumerable<Tuple<K, V>> keyValues)
- toMapUpdate <K, V> (IEnumerable<(K, V)> keyValues)
- toMapUpdate <K, V> (IEnumerable<KeyValuePair<K, V>> keyValues)
- toMapTry <K, V> (IEnumerable<Tuple<K, V>> keyValues)
- toMapTry <K, V> (IEnumerable<(K, V)> keyValues)
- toMapTry <K, V> (IEnumerable<KeyValuePair<K, V>> keyValues)
- Set <T> ()
- Set <T> (T head, params T[] tail)
- toSet <T> (IEnumerable<T> items)
- Set <OrdT, T> ()
- Set <OrdT, T> (T head, params T[] tail)
- toSet <OrdT, T> (IEnumerable<T> items)
- HashSet <T> ()
- HashSet <T> (T head, params T[] tail)
- toHashSet <T> (IEnumerable<T> items)
- HashSet <EqT, T> ()
- HashSet <EqT, T> (T head, params T[] tail)
- toHashSet <EqT, T> (IEnumerable<T> items)
- Query <T> (params T[] items)
- toQuery <T> (IEnumerable<T> items)
- match <A, B> (IEnumerable<A> list, Func<B> Empty, Func<Seq<A>, B> More)
- match <A, B> (IEnumerable<A> list, Func<B> Empty, Func<A, Seq<A>, B> More)
- match <T, R> (IEnumerable<T> list, Func<R> Empty, Func<T, R> One, Func<T, Seq<T>, R> More)
- match <K, V, R> (Map<K, V> map, K key, Func<V, R> Some, Func<R> None)
- match <K, V> (Map<K, V> map, K key, Action<V> Some, Action None)
- match <K, V, R> (HashMap<K, V> map, K key, Func<V, R> Some, Func<R> None)
- match <K, V> (HashMap<K, V> map, K key, Action<V> Some, Action None)
- Seq <A> ()
- Seq1 <A> (A value)
- Seq <A> (A a, A b)
- Seq <A> (A a, A b, A c)
- Seq <A> (A a, A b, A c, A d)
- Seq <A> (A a, A b, A c, A d, A e)
- Seq <A> (A a, A b, A c, A d, A e, A f)
- Seq <A> (A a, A b, A c, A d, A e, A f, A g)
- Seq <A> (A a, A b, A c, A d, A e, A f, A g, A h)
- Seq <A> (A a, A b, A c, A d, A e, A f, A g, A h, params A[] tail)
- Seq <A> (IEnumerable<A> value)
- toSeq <A> (IEnumerable<A> value)
- toSeq <A> (A? value)
- toSeq <A> (A[] value)
- toSeq <A> (Arr<A> value)
- toSeq <A> (IList<A> value)
- toSeq <A> (ICollection<A> value)
- toSeq <L, R> (Either<L, R> value)
- toSeq <L, R> (EitherUnsafe<L, R> value)
- toSeq <A> (Try<A> value)
- toSeq <A> (TryOption<A> value)
- toSeq <T> (TryAsync<T> value)
- toSeq <T> (TryOptionAsync<T> value)
- toSeq <A> (Tuple<A> tup)
- toSeq <A> (Tuple<A, A> tup)
- toSeq <A> (Tuple<A, A, A> tup)
- toSeq <A> (Tuple<A, A, A, A> tup)
- toSeq <A> (Tuple<A, A, A, A, A> tup)
- toSeq <A> (Tuple<A, A, A, A, A, A> tup)
- toSeq <A> (Tuple<A, A, A, A, A, A, A> tup)
- toSeq <A> (ValueTuple<A> tup)
- toSeq <A> (ValueTuple<A, A> tup)
- toSeq <A> (ValueTuple<A, A, A> tup)
- toSeq <A> (ValueTuple<A, A, A, A> tup)
- toSeq <A> (ValueTuple<A, A, A, A, A> tup)
- toSeq <A> (ValueTuple<A, A, A, A, A, A> tup)
- toSeq <A> (ValueTuple<A, A, A, A, A, A, A> tup)
- AtomSeq <A> ()
- AtomSeq <A> (params A[] items)
- AtomSeq <A> (Seq<A> items)
- AtomSeq <A> (IEnumerable<A> items)
- Diff <EqA, A> (this IEnumerable<A> va, IEnumerable<A> vb)
- Apply <EqA, A> (this IEnumerable<A> va, Patch<EqA, A> patch)
- Apply <EqA, A> (this Lst<A> va, Patch<EqA, A> patch)
- Apply <EqA, A> (this Seq<A> va, Patch<EqA, A> patch)
- Apply <EqA, A> (this SpanArray<A> va, Patch<EqA, A> patch)
- Apply <EqA, A> (this A[] va, Patch<EqA, A> patch)
- Apply <EqA, A> (this Arr<A> va, Patch<EqA, A> patch)
- Apply <EqA, A> (this List<A> va, Patch<EqA, A> patch)
- Applicable <EqA, A> (this IEnumerable<A> va, Patch<EqA, A> patch)
Sub modules
Arr |
BiMap |
HashMap |
HashSet |
List |
Map |
Queue |
Seq |
Set |
Stack |
TrackingHashMap |
TrieMap |
TrieSet |
field SeqEmpty Empty = new SeqEmpty() Source #
Represents an empty sequence
property IEnumerable<long> LongNaturals Source #
Lazy sequence of natural numbers up to Int64.MaxValue
method Seq<A> Cons <A> (this A head) Source #
Construct a sequence from any value
type | A | Type of the items in the sequence |
param | head | Head item in the sequence |
returns |
method Seq<A> Cons <A> (this A head, SeqEmpty empty) Source #
Construct a sequence from any value
type | A | Type of the items in the sequence |
param | head | Head item in the sequence |
returns |
method Seq<A> Cons <A> (this A head, Seq<A> tail) Source #
Construct a list from head and tail; head becomes the first item in the list.
type | A | Type of the items in the sequence |
param | head | Head item in the sequence |
param | tail | Tail of the sequence |
returns |
method Seq<A> Cons <A> (this A head, A[] tail) Source #
Construct a list from head and tail; head becomes the first item in the list.
type | A | Type of the items in the sequence |
param | head | Head item in the sequence |
param | tail | Tail of the sequence |
returns |
method Seq<A> Cons <A> (this A head, Arr<A> tail) Source #
Construct a list from head and tail; head becomes the first item in the list.
type | A | Type of the items in the sequence |
param | head | Head item in the sequence |
param | tail | Tail of the sequence |
returns |
method Seq<A> Cons <A> (this A head, IEnumerable<A> tail) Source #
Construct a list from head and tail; head becomes the first item in the list.
type | A | Type of the items in the sequence |
param | head | Head item in the sequence |
param | tail | Tail of the sequence |
returns |
method Lst<A> Cons <A> (this A head, Lst<A> tail) Source #
Construct a list from head and tail; head becomes the first item in the list.
type | A | Type of the items in the sequence |
param | head | Head item in the sequence |
param | tail | Tail of the sequence |
returns |
method IEnumerable<A> Sort <OrdA, A> (this IEnumerable<A> xs) Source #
Provide a sorted enumerable
method Seq<A> Sort <OrdA, A> (this Seq<A> xs) Source #
Provide a sorted Seq
method Lst<A> Sort <OrdA, A> (this Lst<A> xs) Source #
Provide a sorted Lst
method Arr<A> Sort <OrdA, A> (this Arr<A> xs) Source #
Provide a sorted Arr
method IEnumerable<int> Range (int from, int count, int step = 1) Source #
Lazily generate a range of integers.
method Seq<char> Range (char from, char to) Source #
Lazily generate a range of chars.
Remarks: Can go in a positive direction ('a'..'z') as well as negative ('z'..'a')
method IEnumerable<int> Range (params IEnumerable<int>[] ranges) Source #
Lazily generate integers from any number of provided ranges
method IEnumerable<char> Range (params IEnumerable<char>[] ranges) Source #
Lazily generate chars from any number of provided ranges
method Map<K, V> Map <K, V> (Tuple<K, V> head, params Tuple<K, V>[] tail) Source #
Create an immutable map
method Map<K, V> Map <K, V> (KeyValuePair<K, V> head, params KeyValuePair<K, V>[] tail) Source #
Create an immutable map
method Map<K, V> toMap <K, V> (IEnumerable<KeyValuePair<K, V>> items) Source #
Create an immutable map
method Map<OrdK, K, V> Map <OrdK, K, V> () Source #
Create an immutable map
method Map<OrdK, K, V> Map <OrdK, K, V> (Tuple<K, V> head, params Tuple<K, V>[] tail) Source #
Create an immutable map
method Map<OrdK, K, V> Map <OrdK, K, V> ((K, V) head, params (K, V)[] tail) Source #
Create an immutable map
method Map<OrdK, K, V> toMap <OrdK, K, V> (KeyValuePair<K, V> head, params KeyValuePair<K, V>[] tail) Source #
Create an immutable map
method Map<OrdK, K, V> toMap <OrdK, K, V> (IEnumerable<(K, V)> items) Source #
Create an immutable map
method Map<OrdK, K, V> toMap <OrdK, K, V> (IEnumerable<Tuple<K, V>> items) Source #
Create an immutable map
method Map<OrdK, K, V> toMap <OrdK, K, V> (IEnumerable<KeyValuePair<K, V>> items) Source #
Create an immutable map
method HashMap<K, V> HashMap <K, V> (Tuple<K,V> head, params Tuple<K, V>[] tail) Source #
Create an immutable hash-map
method HashMap<K, V> HashMap <K, V> ((K, V) head, params (K, V)[] tail) Source #
Create an immutable hash-map
method HashMap<K, V> HashMap <K, V> (KeyValuePair<K, V> head, params KeyValuePair<K, V>[] tail) Source #
Create an immutable hash-map
method HashMap<K, V> toHashMap <K, V> (IEnumerable<(K, V)> items) Source #
Create an immutable hash-map
method HashMap<K, V> toHashMap <K, V> (IEnumerable<Tuple<K, V>> items) Source #
Create an immutable hash-map
method HashMap<K, V> toHashMap <K, V> (IEnumerable<KeyValuePair<K, V>> items) Source #
Create an immutable hash-map
method HashMap<EqK, K, V> HashMap <EqK, K, V> () Source #
Create an immutable hash-map
method HashMap<EqK, K, V> HashMap <EqK, K, V> (Tuple<K, V> head, params Tuple<K, V>[] tail) Source #
Create an immutable hash-map
method HashMap<EqK, K, V> HashMap <EqK, K, V> ((K, V) head, params (K, V)[] tail) Source #
Create an immutable hash-map
method HashMap<EqK, K, V> HashMap <EqK, K, V> (KeyValuePair<K, V> head, params KeyValuePair<K, V>[] tail) Source #
Create an immutable hash-map
method HashMap<EqK, K, V> toHashMap <EqK, K, V> (IEnumerable<Tuple<K, V>> items) Source #
Create an immutable hash-map
method HashMap<EqK, K, V> toHashMap <EqK, K, V> (IEnumerable<(K, V)> items) Source #
Create an immutable hash-map
method HashMap<EqK, K, V> toHashMap <EqK, K, V> (IEnumerable<KeyValuePair<K, V>> items) Source #
Create an immutable hash-map
method TrackingHashMap<K, V> TrackingHashMap <K, V> () Source #
Create an immutable tracking hash-map
method TrackingHashMap<K, V> TrackingHashMap <K, V> (Tuple<K,V> head, params Tuple<K, V>[] tail) Source #
Create an immutable tracking hash-map
method TrackingHashMap<K, V> TrackingHashMap <K, V> ((K, V) head, params (K, V)[] tail) Source #
Create an immutable tracking hash-map
method TrackingHashMap<K, V> TrackingHashMap <K, V> (KeyValuePair<K, V> head, params KeyValuePair<K, V>[] tail) Source #
Create an immutable tracking hash-map
method TrackingHashMap<K, V> toTrackingHashMap <K, V> (IEnumerable<(K, V)> items) Source #
Create an immutable tracking hash-map
method TrackingHashMap<K, V> toTrackingHashMap <K, V> (IEnumerable<Tuple<K, V>> items) Source #
Create an immutable tracking hash-map
method TrackingHashMap<K, V> toTrackingHashMap <K, V> (IEnumerable<KeyValuePair<K, V>> items) Source #
Create an immutable tracking hash-map
method TrackingHashMap<EqK, K, V> TrackingHashMap <EqK, K, V> () Source #
Create an immutable tracking hash-map
method TrackingHashMap<EqK, K, V> TrackingHashMap <EqK, K, V> (Tuple<K, V> head, params Tuple<K, V>[] tail) Source #
Create an immutable tracking hash-map
method TrackingHashMap<EqK, K, V> TrackingHashMap <EqK, K, V> ((K, V) head, params (K, V)[] tail) Source #
Create an immutable tracking hash-map
method TrackingHashMap<EqK, K, V> TrackingHashMap <EqK, K, V> (KeyValuePair<K, V> head, params KeyValuePair<K, V>[] tail) Source #
Create an immutable tracking hash-map
method TrackingHashMap<EqK, K, V> toTrackingHashMap <EqK, K, V> (IEnumerable<Tuple<K, V>> items) Source #
Create an immutable tracking hash-map
method TrackingHashMap<EqK, K, V> toTrackingHashMap <EqK, K, V> (IEnumerable<(K, V)> items) Source #
Create an immutable tracking hash-map
method TrackingHashMap<EqK, K, V> toTrackingHashMap <EqK, K, V> (IEnumerable<KeyValuePair<K, V>> items) Source #
Create an immutable tracking hash-map
method AtomHashMap<K, V> AtomHashMap <K, V> () Source #
Create an immutable hash-map
method AtomHashMap<K, V> AtomHashMap <K, V> ((K, V) head, params (K, V)[] tail) Source #
Create an immutable hash-map
method AtomHashMap<K, V> AtomHashMap <K, V> (HashMap<K, V> items) Source #
Create an immutable hash-map
method AtomHashMap<K, V> AtomHashMap <K, V> (KeyValuePair<K, V> head, params KeyValuePair<K, V>[] tail) Source #
Create an immutable hash-map
method AtomHashMap<K, V> toAtomHashMap <K, V> (IEnumerable<(K, V)> items) Source #
Create an immutable hash-map
method AtomHashMap<K, V> toAtomHashMap <K, V> (IEnumerable<KeyValuePair<K, V>> items) Source #
Create an immutable hash-map
method AtomHashMap<EqK, K, V> AtomHashMap <EqK, K, V> () Source #
Create an immutable hash-map
method AtomHashMap<EqK, K, V> AtomHashMap <EqK, K, V> ((K, V) head, params (K, V)[] tail) Source #
Create an immutable hash-map
method AtomHashMap<EqK, K, V> AtomHashMap <EqK, K, V> (KeyValuePair<K, V> head, params KeyValuePair<K, V>[] tail) Source #
Create an immutable hash-map
method AtomHashMap<EqK, K, V> AtomHashMap <EqK, K, V> (HashMap<EqK, K, V> items) Source #
Create an immutable hash-map
method AtomHashMap<EqK, K, V> toAtomHashMap <EqK, K, V> (IEnumerable<(K, V)> items) Source #
Create an immutable hash-map
method AtomHashMap<EqK, K, V> toAtomHashMap <EqK, K, V> (IEnumerable<KeyValuePair<K, V>> items) Source #
Create an immutable hash-map
method Lst<PredList, T> List <PredList, T> () Source #
Create an immutable list
method Lst<PredList, T> List <PredList, T> (T x, params T[] xs) Source #
Create an immutable list
method Lst<PredList, T> toList <PredList, T> (Arr<T> items) Source #
Create an immutable list
method Lst<PredList, T> toList <PredList, T> (IEnumerable<T> items) Source #
Create an immutable list
method Lst<PredList, PredItem, T> List <PredList, PredItem, T> () Source #
Create an immutable list
method Lst<PredList, PredItem, T> List <PredList, PredItem, T> (T x, params T[] xs) Source #
Create an immutable list
method Lst<PredList, PredItem, T> toList <PredList, PredItem, T> (Arr<T> items) Source #
Create an immutable list
method Lst<PredList, PredItem, T> toList <PredList, PredItem, T> (IEnumerable<T> items) Source #
Create an immutable list
method Stck<T> toStackRev <T> (IEnumerable<T> items) Source #
Create an immutable stack
method Map<K, V> toMapUpdate <K, V> (IEnumerable<Tuple<K, V>> keyValues) Source #
Create an immutable map, updating duplicates so that the final value of any key is retained
method Map<K, V> toMapUpdate <K, V> (IEnumerable<(K, V)> keyValues) Source #
Create an immutable map, updating duplicates so that the final value of any key is retained
method Map<K, V> toMapUpdate <K, V> (IEnumerable<KeyValuePair<K, V>> keyValues) Source #
Create an immutable map, updating duplicates so that the final value of any key is retained
method Map<K, V> toMapTry <K, V> (IEnumerable<Tuple<K, V>> keyValues) Source #
Create an immutable map, ignoring duplicates so the first value of any key is retained
method Map<K, V> toMapTry <K, V> (IEnumerable<(K, V)> keyValues) Source #
Create an immutable map, ignoring duplicates so the first value of any key is retained
method Map<K, V> toMapTry <K, V> (IEnumerable<KeyValuePair<K, V>> keyValues) Source #
Create an immutable map, ignoring duplicates so the first value of any key is retained
method Set<OrdT, T> Set <OrdT, T> (T head, params T[] tail) Source #
Create an immutable set
method Set<OrdT, T> toSet <OrdT, T> (IEnumerable<T> items) Source #
Create an immutable set
method HashSet<EqT, T> HashSet <EqT, T> () Source #
Create an immutable hash-set
method HashSet<EqT, T> HashSet <EqT, T> (T head, params T[] tail) Source #
Create an immutable hash-set
method HashSet<EqT, T> toHashSet <EqT, T> (IEnumerable<T> items) Source #
Create an immutable hash-set
method B match <A, B> (IEnumerable<A> list, Func<B> Empty, Func<Seq<A>, B> More) Source #
Match empty list, or multi-item list
type | B | Return value type |
param | Empty | Match for an empty list |
param | More | Match for a non-empty |
returns | Result of match function invoked |
method B match <A, B> (IEnumerable<A> list, Func<B> Empty, Func<A, Seq<A>, B> More) Source #
List pattern matching
method R match <T, R> (IEnumerable<T> list, Func<R> Empty, Func<T, R> One, Func<T, Seq<T>, R> More) Source #
List pattern matching
method Seq<A> Seq <A> (A a, A b, A c) Source #
Construct a sequence from any value
var list = Seq(1, 2, 3);
method Seq<A> Seq <A> (A a, A b, A c, A d) Source #
Construct a sequence from any value
var list = Seq(1, 2, 3, 4);
method Seq<A> Seq <A> (A a, A b, A c, A d, A e) Source #
Construct a sequence from any value
var list = Seq(1, 2, 3, 4, 5);
method Seq<A> Seq <A> (A a, A b, A c, A d, A e, A f) Source #
Construct a sequence from any value
var list = Seq(1, 2, 3, 4, 5, 6);
method Seq<A> Seq <A> (A a, A b, A c, A d, A e, A f, A g) Source #
Construct a sequence from any value
var list = Seq(1, 2, 3, 4, 5, 6, 7);
method Seq<A> Seq <A> (A a, A b, A c, A d, A e, A f, A g, A h) Source #
Construct a sequence from any value
var list = Seq(1, 2, 3, 4, 5, 6, 7, 8);
method Seq<A> Seq <A> (A a, A b, A c, A d, A e, A f, A g, A h, params A[] tail) Source #
Construct a sequence from any value
var list = Seq(1, 2, 3, 4);
method Seq<A> Seq <A> (IEnumerable<A> value) Source #
Construct a sequence from an Enumerable
Deals with value == null
by returning []
and also memoizes the
items in the enumerable as they're being consumed.
method Seq<A> toSeq <A> (IEnumerable<A> value) Source #
Construct a sequence from an Enumerable
Deals with value == null
by returning []
and also memoizes the
items in the enumerable as they're being consumed.
method Seq<A> toSeq <A> (A? value) Source #
Construct a sequence from a nullable HasValue == true : [x] HasValue == false : []
method Seq<R> toSeq <L, R> (Either<L, R> value) Source #
Construct a sequence from an either Right(x) : [x] Left(y) : []
method Seq<R> toSeq <L, R> (EitherUnsafe<L, R> value) Source #
Construct a sequence from an either Right(x) : [x] Left(y) : []
method Seq<A> toSeq <A> (Try<A> value) Source #
Construct a sequence from a Try Succ(x) : [x] Fail(e) : [] null : []
method Seq<A> toSeq <A> (TryOption<A> value) Source #
Construct a sequence from a TryOption Succ(x) : [x] Fail(e) : [] None : [] null : []
method Task<Seq<T>> toSeq <T> (TryAsync<T> value) Source #
Construct a sequence from a TryOption Succ(x) : [x] Fail(e) : [] None : [] null : []
method Task<Seq<T>> toSeq <T> (TryOptionAsync<T> value) Source #
Construct a sequence from a TryOption Succ(x) : [x] Fail(e) : [] None : [] null : []
method Seq<A> toSeq <A> (ValueTuple<A, A, A, A, A, A> tup) Source #
Construct a sequence from a tuple
method Seq<A> toSeq <A> (ValueTuple<A, A, A, A, A, A, A> tup) Source #
Construct a sequence from a tuple
method Patch<EqA, A> Diff <EqA, A> (this IEnumerable<A> va, IEnumerable<A> vb) Source #
Compute the difference between two documents, using the Wagner-Fischer algorithm. O(mn) time and space.
apply(diff(d,e), d) == e
diff(d, d) == Patch.empty
apply(diff(d, e), d) == apply(inverse(diff(e, d)), d)
apply(append(diff(a, b), diff(b, c), a) == apply(diff(a, c), a)
applicable(diff(a, b) a)
method IEnumerable<A> Apply <EqA, A> (this IEnumerable<A> va, Patch<EqA, A> patch) Source #
Apply the supplied patch to this collection
method Lst<A> Apply <EqA, A> (this Lst<A> va, Patch<EqA, A> patch) Source #
Apply the supplied patch to this collection
method Seq<A> Apply <EqA, A> (this Seq<A> va, Patch<EqA, A> patch) Source #
Apply the supplied patch to this collection
method SpanArray<A> Apply <EqA, A> (this SpanArray<A> va, Patch<EqA, A> patch) Source #
Apply the supplied patch to this collection
method A[] Apply <EqA, A> (this A[] va, Patch<EqA, A> patch) Source #
Apply the supplied patch to this collection
method Arr<A> Apply <EqA, A> (this Arr<A> va, Patch<EqA, A> patch) Source #
Apply the supplied patch to this collection
method List<A> Apply <EqA, A> (this List<A> va, Patch<EqA, A> patch) Source #
Apply the supplied patch to this collection
method bool Applicable <EqA, A> (this IEnumerable<A> va, Patch<EqA, A> patch) Source #
Returns true if a patch can be safely applied to a document, that is,
applicable(p, d)
holds when d
is a valid source document for the patch p
.