<commit_before>/**
*
* spica.d.ts
*
* @author falsandtru https://github.com/falsandtru/spica
*/

declare module 'spica' {
  export namespace Supervisor {
    export namespace Event {
      export namespace Data {
        export type Exec<T extends string[], D, R> = [T, (data: D) => R];
        export type Fail<T extends string[], D, R> = [T, (data: D) => R, D];
        export type Loss<T extends string[], D, R> = [T, (data: D) => R, D];
        export type Exit<T extends string[], D, R> = [T, (data: D) => R, any];
      }
    }
  }
  export abstract class Supervisor<T extends string[], D, R> {
    static count: number;
    static procs: number;
    constructor(settings?: SupervisorSettings<T>)
    name: string;
    events: {
      exec: Observer<T, Supervisor.Event.Data.Exec<T, D, R>, any>;
      fail: Observer<T, Supervisor.Event.Data.Fail<T, D, R>, any>;
      loss: Observer<T, Supervisor.Event.Data.Loss<T, D, R>, any>;
      exit: Observer<T, Supervisor.Event.Data.Exit<T, D, R>, any>;
    };
    register(namespace: T, process: (data: D) => R): (reason?: any) => void;
    call(namespace: T, data: D, timeout?: number, callback?: (results: R[], data: D) => any): void;
    cast(namespace: T, data: D, retry?: boolean): R[];
    refs(namespace: T): [T, (data: D) => R, (reason: any) => void][];
    terminate(namespace?: T, reason?: any): void;
  }
  export interface SupervisorSettings<T> {
    name?: string;
    dependencies?: [T, T[]][];
    retry?: boolean;
    timeout?: number;
    destructor?: (reason?: any) => any;
  }

  export class Observable<T extends Array<string | number>, D, R>
    implements Observer<T, D, R>, Publisher<T, D, R> {
    monitor(type: T, subscriber: Subscriber<D, R>): () => void;
    on(type: T, subscriber: Subscriber<D, R>): () => void;
    off(type: T, subscriber?: Subscriber<D, R>): void;
    once(type: T, subscriber: Subscriber<D, R>): () => void;
    emit(type: T, data: D, tracker?: (data: D, results: R[]) => any): void;
    reflect(type: T, data: D): R[];
    refs(type: T): [T, Subscriber<D, R>, boolean][];
  }
  export interface Observer<T extends Array<string | number>, D, R> {
    monitor(type: T, subscriber: Subscriber<D, R>): () => void;
    on(type: T, subscriber: Subscriber<D, R>): () => void;
    off(type: T, subscriber?: Subscriber<D, R>): void;
    once(type: T, subscriber: Subscriber<D, R>): () => void;
  }
  export interface Publisher<T extends Array<string | number>, D, R> {
    emit(type: T, data: D, tracker?: (data: D, results: any[]) => any): void;
    reflect(type: T, data: D): R[];
  }
  export interface Subscriber<D, R> {
    (data: D): R;
  }

  export class Cancelable<L> {
    cancel: (reason: L) => void;
    promise: <T>(val: T) => Promise<T>;
    maybe: <T>(val: T) => Maybe<T>;
    either: <R>(val: R) => Either<L, R>;
  }

  abstract class Lazy<T> {
  }
  abstract class Functor<T> extends Lazy<T> {
    abstract fmap<U>(f: (val: T) => U): Functor<U>;
  }
  abstract class Monad<T> extends Functor<T> {
    abstract bind<U>(f: (val: T) => Monad<U>): Monad<U>;
  }
  namespace Monad {
    export function Return<T>(val: T): Monad<T>;
  }
  abstract class MonadPlus<T> extends Monad<T> {
    static mzero: MonadPlus<any>;
    static mplus<T>(a: MonadPlus<T>, b: MonadPlus<T>): MonadPlus<T>;
  }

  export class Sequence<T, S> extends MonadPlus<T> {
    static from<T>(as: T[]): Sequence<T, number>;
    static write<T>(as: T[]): Sequence<T, T[]>;
    static random(): Sequence<number, number>;
    static random<T>(gen: () => T): Sequence<T, number>;
    static random<T>(as: T[]): Sequence<T, Sequence.Iterator<number>>;
    static zip<T, U>(a: Sequence<T, any>, b: Sequence<U, any>): Sequence<[T, U], [Sequence.Iterator<T>, Sequence.Iterator<U>]>;
    static concat<T>(as: Sequence<Sequence<T, any>, any>): Sequence<T, [Sequence.Iterator<Sequence<T, any>>, Sequence.Iterator<T>]>;
    static union<T>(cmp: (a: T, b: T) => number, as: Sequence<T, any>[]): Sequence<T, [Sequence.Iterator<T>, Sequence.Iterator<T>]>;
    static intersect<T>(cmp: (a: T, b: T) => number, as: Sequence<T, any>[]): Sequence<T, [Sequence.Iterator<T>, Sequence.Iterator<T>]>;
    static mempty: Sequence<any, any>;
    static mappend<T>(a: Sequence<T, any>, b: Sequence<T, any>): Sequence<T, [Sequence.Iterator<T>, Sequence.Iterator<T>]>;
    static mconcat<T>(as: Sequence<T, any>[]): Sequence<T, [Sequence.Iterator<T>, Sequence.Iterator<T>]>;
    static mzero: Sequence<any, any>;
    static mplus<T>(a: Sequence<T, any>, b: Sequence<T, any>): Sequence<T, [Sequence.Iterator<T>, Sequence.Iterator<T>]>;
    constructor(cons: (p: S, cons: (value?: T, next?: S) => Sequence.Data<T, S>) => Sequence.Data<T, S>);
    iterate(): Sequence.Thunk<T>;
    read(): T[];
    fmap<U>(f: (p: T) => U): Sequence<U, Sequence.Iterator<T>>;
    bind<U>(f: (p: T) => Sequence<U, any>): Sequence<U, [Sequence.Iterator<Sequence<U, any>>, Sequence.Iterator<U>]>;
    mapM<U>(f: (p: T) => Sequence<U, any>): Sequence<U[], [Sequence.Iterator<Sequence<U[], any>>, Sequence.Iterator<U[]>]>;
    filterM(f: (p: T) => Sequence<boolean, any>): Sequence<T[], [Sequence.Iterator<Sequence<T[], any>>, Sequence.Iterator<T[]>]>;
    map<U>(f: (p: T, i: number) => U): Sequence<U, Sequence.Iterator<T>>;
    filter(f: (p: T, i: number) => boolean): Sequence<T, Sequence.Iterator<T>>;
    scan<U>(f: (b: U, a: T) => U, z: U): Sequence<U, [U, Sequence.Iterator<T>]>;
    take(n: number): Sequence<T, Sequence.Iterator<T>>;
    drop(n: number): Sequence<T, Sequence.Iterator<T>>;
    takeWhile(f: (p: T) => boolean): Sequence<T, Sequence.Iterator<T>>;
    dropWhile(f: (p: T) => boolean): Sequence<T, Sequence.Iterator<T>>;
    takeUntil(f: (p: T) => boolean): Sequence<T, Sequence.Iterator<T>>;
    dropUntil(f: (p: T) => boolean): Sequence<T, Sequence.Iterator<T>>;
    memoize(memory?: Map<number, Sequence.Data<T, S>>): Sequence<T, S>;
  }
  export namespace Sequence {
    export type Data<T, S> = [T, S];
    export type Thunk<T> = [T, Iterator<T>, number];
    export type Iterator<T> = () => Thunk<T>;
  }
<commit_msg>feat(sequence): implement Sequence.Return static method<commit_after>/**
*
* spica.d.ts
*
* @author falsandtru https://github.com/falsandtru/spica
*/

declare module 'spica' {
  export namespace Supervisor {
    export namespace Event {
      export namespace Data {
        export type Exec<T extends string[], D, R> = [T, (data: D) => R];
        export type Fail<T extends string[], D, R> = [T, (data: D) => R, D];
        export type Loss<T extends string[], D, R> = [T, (data: D) => R, D];
        export type Exit<T extends string[], D, R> = [T, (data: D) => R, any];
      }
    }
  }
  export abstract class Supervisor<T extends string[], D, R> {
    static count: number;
    static procs: number;
    constructor(settings?: SupervisorSettings<T>)
    name: string;
    events: {
      exec: Observer<T, Supervisor.Event.Data.Exec<T, D, R>, any>;
      fail: Observer<T, Supervisor.Event.Data.Fail<T, D, R>, any>;
      loss: Observer<T, Supervisor.Event.Data.Loss<T, D, R>, any>;
      exit: Observer<T, Supervisor.Event.Data.Exit<T, D, R>, any>;
    };
    register(namespace: T, process: (data: D) => R): (reason?: any) => void;
    call(namespace: T, data: D, timeout?: number, callback?: (results: R[], data: D) => any): void;
    cast(namespace: T, data: D, retry?: boolean): R[];
    refs(namespace: T): [T, (data: D) => R, (reason: any) => void][];
    terminate(namespace?: T, reason?: any): void;
  }
  export interface SupervisorSettings<T> {
    name?: string;
    dependencies?: [T, T[]][];
    retry?: boolean;
    timeout?: number;
    destructor?: (reason?: any) => any;
  }

  export class Observable<T extends Array<string | number>, D, R>
    implements Observer<T, D, R>, Publisher<T, D, R> {
    monitor(type: T, subscriber: Subscriber<D, R>): () => void;
    on(type: T, subscriber: Subscriber<D, R>): () => void;
    off(type: T, subscriber?: Subscriber<D, R>): void;
    once(type: T, subscriber: Subscriber<D, R>): () => void;
    emit(type: T, data: D, tracker?: (data: D, results: R[]) => any): void;
    reflect(type: T, data: D): R[];
    refs(type: T): [T, Subscriber<D, R>, boolean][];
  }
  export interface Observer<T extends Array<string | number>, D, R> {
    monitor(type: T, subscriber: Subscriber<D, R>): () => void;
    on(type: T, subscriber: Subscriber<D, R>): () => void;
    off(type: T, subscriber?: Subscriber<D, R>): void;
    once(type: T, subscriber: Subscriber<D, R>): () => void;
  }
  export interface Publisher<T extends Array<string | number>, D, R> {
    emit(type: T, data: D, tracker?: (data: D, results: any[]) => any): void;
    reflect(type: T, data: D): R[];
  }
  export interface Subscriber<D, R> {
    (data: D): R;
  }

  export class Cancelable<L> {
    cancel: (reason: L) => void;
    promise: <T>(val: T) => Promise<T>;
    maybe: <T>(val: T) => Maybe<T>;
    either: <R>(val: R) => Either<L, R>;
  }

  abstract class Lazy<T> {
  }
  abstract class Functor<T> extends Lazy<T> {
    abstract fmap<U>(f: (val: T) => U): Functor<U>;
  }
  abstract class Monad<T> extends Functor<T> {
    abstract bind<U>(f: (val: T) => Monad<U>): Monad<U>;
  }
  namespace Monad {
    export function Return<T>(val: T): Monad<T>;
  }
  abstract class MonadPlus<T> extends Monad<T> {
    static mzero: MonadPlus<any>;
    static mplus<T>(a: MonadPlus<T>, b: MonadPlus<T>): MonadPlus<T>;
  }

  export class Sequence<T, S> extends MonadPlus<T> {
    static from<T>(as: T[]): Sequence<T, number>;
    static write<T>(as: T[]): Sequence<T, T[]>;
    static random(): Sequence<number, number>;
    static random<T>(gen: () => T): Sequence<T, number>;
    static random<T>(as: T[]): Sequence<T, Sequence.Iterator<number>>;
    static zip<T, U>(a: Sequence<T, any>, b: Sequence<U, any>): Sequence<[T, U], [Sequence.Iterator<T>, Sequence.Iterator<U>]>;
    static concat<T>(as: Sequence<Sequence<T, any>, any>): Sequence<T, [Sequence.Iterator<Sequence<T, any>>, Sequence.Iterator<T>]>;
    static union<T>(cmp: (a: T, b: T) => number, as: Sequence<T, any>[]): Sequence<T, [Sequence.Iterator<T>, Sequence.Iterator<T>]>;
    static intersect<T>(cmp: (a: T, b: T) => number, as: Sequence<T, any>[]): Sequence<T, [Sequence.Iterator<T>, Sequence.Iterator<T>]>;
    static Return<T>(a: T): Sequence<T, number>;
    static mempty: Sequence<any, any>;
    static mappend<T>(a: Sequence<T, any>, b: Sequence<T, any>): Sequence<T, [Sequence.Iterator<T>, Sequence.Iterator<T>]>;
    static mconcat<T>(as: Sequence<T, any>[]): Sequence<T, [Sequence.Iterator<T>, Sequence.Iterator<T>]>;
    static mzero: Sequence<any, any>;
    static mplus<T>(a: Sequence<T, any>, b: Sequence<T, any>): Sequence<T, [Sequence.Iterator<T>, Sequence.Iterator<T>]>;
    constructor(cons: (p: S, cons: (value?: T, next?: S) => Sequence.Data<T, S>) => Sequence.Data<T, S>);
    iterate(): Sequence.Thunk<T>;
    read(): T[];
    fmap<U>(f: (p: T) => U): Sequence<U, Sequence.Iterator<T>>;
    bind<U>(f: (p: T) => Sequence<U, any>): Sequence<U, [Sequence.Iterator<Sequence<U, any>>, Sequence.Iterator<U>]>;
    mapM<U>(f: (p: T) => Sequence<U, any>): Sequence<U[], [Sequence.Iterator<Sequence<U[], any>>, Sequence.Iterator<U[]>]>;
    filterM(f: (p: T) => Sequence<boolean, any>): Sequence<T[], [Sequence.Iterator<Sequence<T[], any>>, Sequence.Iterator<T[]>]>;
    map<U>(f: (p: T, i: number) => U): Sequence<U, Sequence.Iterator<T>>;
    filter(f: (p: T, i: number) => boolean): Sequence<T, Sequence.Iterator<T>>;
    scan<U>(f: (b: U, a: T) => U, z: U): Sequence<U, [U, Sequence.Iterator<T>]>;
    take(n: number): Sequence<T, Sequence.Iterator<T>>;
    drop(n: number): Sequence<T, Sequence.Iterator<T>>;
    takeWhile(f: (p: T) => boolean): Sequence<T, Sequence.Iterator<T>>;
    dropWhile(f: (p: T) => boolean): Sequence<T, Sequence.Iterator<T>>;
    takeUntil(f: (p: T) => boolean): Sequence<T, Sequence.Iterator<T>>;
    dropUntil(f: (p: T) => boolean): Sequence<T, Sequence.Iterator<T>>;
    memoize(memory?: Map<number, Sequence.Data<T, S>>): Sequence<T, S>;
  }
  export namespace Sequence {
    export type Data<T, S> = [T, S];
    export type Thunk<T> = [T, Iterator<T>, number];
    export type Iterator<T> = () => Thunk<T>;
  }

{'fraction_non_alphanumeric': 0.20920912734113029, 'fraction_numerical': 0.0, 'mean_word_length': 4.0844074844074845, 'pattern_counts': {'":': 0, '<': 333, '<?xml version=': 0, '>': 415, 'https://': 2, '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': '6467800', 'n_tokens_mistral': 4595, 'n_tokens_neox': 4418, 'n_words': 1211}