// Path: core/src/main/java/eventsrc4j/QueryAPI.java
// public static <K, S, E, V> QueryAPI<K, S, E, V> queryAPI(F<E, F<V, V>> applyEvent, V initialState) {
//   return new QueryAPI<>((event, snapshot) -> event.apply(applyEvent, getView(snapshot).orSome(initialState)));
// }


import fj.F;
import fj.data.List;
import java.time.Instant;
import static eventsrc4j.CommandDecisions.caseOf;
import static eventsrc4j.QueryAPI.queryAPI;
import static eventsrc4j.Snapshots.getSeq;
import static eventsrc4j.WriteResults.caseOf;
package eventsrc4j;



public class CommandAPI<C, K, S, E, V, R> implements ESAction.Factory<K, S, E, V> {

  private final F<C, F<Snapshot<S, V>, CommandDecision<R, E>>> decideFunction;

// Path: core/src/main/java/eventsrc4j/QueryAPI.java
// public static <K, S, E, V> QueryAPI<K, S, E, V> queryAPI(F<E, F<V, V>> applyEvent, V initialState) {
//   return new QueryAPI<>((event, snapshot) -> event.apply(applyEvent, getView(snapshot).orSome(initialState)));
// }


// Path: core/src/main/java/eventsrc4j/CommandAPI.java
import fj.F;
import fj.data.List;
import java.time.Instant;
import static eventsrc4j.CommandDecisions.caseOf;
import static eventsrc4j.QueryAPI.queryAPI;
import static eventsrc4j.Snapshots.getSeq;
import static eventsrc4j.WriteResults.caseOf;

package eventsrc4j;



public class CommandAPI<C, K, S, E, V, R> implements ESAction.Factory<K, S, E, V> {

  private final F<C, F<Snapshot<S, V>, CommandDecision<R, E>>> decideFunction;

  private final QueryAPI<K, S, E, V> queryAPI;