Esempio n. 1
0
 public static S FoldT <A, B, S, V>(this Map <A, Map <B, V> > map, S state, Func <S, V, S> folder) =>
 map.Fold(state, (s, x) => x.Fold(s, folder));
Esempio n. 2
0
 /// <summary>
 /// Atomically folds all items in the map (in order) using the folder function provided.
 /// </summary>
 /// <typeparam name="S">State type</typeparam>
 /// <param name="state">Initial state</param>
 /// <param name="folder">Fold function</param>
 /// <returns>Folded state</returns>
 public static S fold <S, K, V>(Map <K, V> map, S state, Func <S, V, S> folder) =>
 map.Fold(state, folder);