<commit_before>// @flow
import type {Command, Ship} from './ship';
import {allAny} from './ship';

export type SnapshotItem<Effect, Commit> = {
  type: 'Effect',
  effect: Effect,
  result?: any,
} | {
  type: 'Commit',
  commit: Commit
} | {
  type: 'GetState',
  state: any,
} | {
  type: 'All',
  snapshots: (SnapshotItem<Effect, Commit>[])[],
}

export type Snapshot<Effect, Commit> = SnapshotItem<Effect, Commit>[];

function* snapCommand<Effect, Commit, State>(
  command: Command<Effect, Commit, State>
): Ship<Effect, Commit, State, {result: any, snapshotItem: SnapshotItem<Effect, Commit>}> {
  const result = yield {
    type: 'Command',
    command,
  };
  switch (command.type) {
  case 'Effect': {<commit_msg>Fix Flow error<commit_after>// @flow
import type {Command, Ship} from './ship';
import {allAny} from './ship';

export type SnapshotItem<Effect, Commit> = {
  type: 'Effect',
  effect: Effect,
  result?: any,
} | {
  type: 'Commit',
  commit: Commit
} | {
  type: 'GetState',
  state?: any,
} | {
  type: 'All',
  snapshots: (SnapshotItem<Effect, Commit>[])[],
}

export type Snapshot<Effect, Commit> = SnapshotItem<Effect, Commit>[];

function* snapCommand<Effect, Commit, State>(
  command: Command<Effect, Commit, State>
): Ship<Effect, Commit, State, {result: any, snapshotItem: SnapshotItem<Effect, Commit>}> {
  const result = yield {
    type: 'Command',
    command,
  };
  switch (command.type) {
  case 'Effect': {
{'fraction_non_alphanumeric': 0.173582295988935, 'fraction_numerical': 0.0, 'mean_word_length': 4.419475655430712, 'pattern_counts': {'":': 0, '<': 19, '<?xml version=': 0, '>': 19, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2297595', 'n_tokens_mistral': 483, 'n_tokens_neox': 484, 'n_words': 136}