// ets_tracing: off import type { StateInURI, StateOutURI } from "../../Modules/index.js" import * as HKT from "../../Prelude/HKT/index.js" import type { Monad } from "../../Prelude/index.js" import * as StateT from "../Classic/index.js" /** * Take over ownership of "S" making it fixed to provided "S" */ export type V = HKT.CleanParam & HKT.Fix<"S", S> /** * State Input URI with local override of "S", this makes it safe to be * stacked multiple times */ export interface PSIn extends HKT.URI> {} /** * State Output URI with local override of "S", this makes it safe to be * stacked multiple times */ export interface PSOut extends HKT.URI> {} /** * Construct the transformed URI as [StateIn, F, StateOut] */ export type ParametricStateT = [PSIn, ...F, PSOut] export function monad() { return (M: Monad) => getMonad_(M) } function getMonad_( M: Monad ): Monad, V> function getMonad_( M: Monad> ): Monad, S>, V> { return HKT.instance(StateT.monad(M)) }