since import { IO } from 'fp-ts/lib/IO' ; import { Monad3 } from 'fp-ts/lib/Monad' ; import { MonadThrow3 } from 'fp-ts/lib/MonadThrow' ; import { State } from 'fp-ts/lib/State' ; import { getStateM } from 'fp-ts/lib/StateT' ; import { Task } from 'fp-ts/lib/Task' ; import * as E from 'fp-ts/lib/Either' ; import { pipeable , pipe } from 'fp-ts/lib/pipeable' ; import { Bifunctor3 } from 'fp-ts/lib/Bifunctor' ; import { Alt3 } from 'fp-ts/lib/Alt' ; import { MonadTask3 } from 'fp-ts/lib/MonadTask' ; import * as F from './Future' ; const T = getStateM ( F . future ) ; declare module 'fp-ts/lib/HKT' { interface URItoKind3 < R , E , A > { StateFuture : StateFuture < R , E , A > ; } } since export const URI = 'StateFuture' ; since export type URI = typeof URI ; since export interface StateFuture < S , E , A > { ( s ) : F . Future < E , [ A , S ] > ; } since export const evalState = T . evalState ; since export const execState = T . execState ; since export function left < S , E , A = never > ( e ) { return fromFuture ( F . left ( e ) ) ; } since export const right = T . of ; since export function rightTask < S , E = never , A = never > ( ma ) { return fromFuture ( F . rightTask ( ma ) ) ; } since export function leftTask < S , E , A = never > ( me ) { return fromFuture ( F . leftTask ( me ) ) ; } since export const fromFuture = T . fromM ; since export function rightIO < S , E = never , A = never > ( ma ) { return fromFuture ( F . rightIO ( ma ) ) ; } since export function leftIO < S , E , A = never > ( me ) { return fromFuture ( F . leftIO ( me ) ) ; } since export const rightState = T . fromState ; since export function leftState < S , E , A = never > ( me ) { return s => F . left ( me ( s ) [ 0 ] ) ; } since export function orElse < S , E , M , A > ( f ) { return ma => c => pipe ( ma ( c ) , F . orElse ( e => f ( e ) ( c ) ) ) ; } since export const get = T . get ; since export const put = T . put ; since export const modify = T . modify ; since export const gets = T . gets ; since export function fromEitherK < E , A extends Array < unknown > , B > ( f ) { return ( ... a ) => fromEither ( f ( ... a ) ) ; } since export function chainEitherK < E , A , B > ( f ) { return chain < any , E , A , B > ( fromEitherK ( f ) ) ; } since export function fromFutureK < E , A extends Array < unknown > , B > ( f ) { return ( ... a ) => fromFuture ( f ( ... a ) ) ; } since export function chainFutureK < E , A , B > ( f ) { return chain < any , E , A , B > ( fromFutureK ( f ) ) ; } since export const stateFuture = { URI , map : T . map , of : right , ap : T . ap , chain : T . chain , throwError : left , alt : ( fx , f ) => c => pipe ( fx ( c ) , F . alt ( ( ) => f ( ) ( c ) ) ) , bimap : ( fea , f , g ) => c => pipe ( fea ( c ) , F . bimap ( f , ( [ a , c ] ) => [ g ( a ) , c ] ) ) , mapLeft : ( fea , f ) => c => pipe ( fea ( c ) , F . mapLeft ( f ) ) , fromIO : rightIO , fromTask : rightTask } ; const { alt , ap , apFirst , apSecond , bimap , chain , chainFirst , flatten , map , mapLeft , filterOrElse , fromEither , fromOption , fromPredicate } = pipeable ( stateFuture ) ; export { alt , ap , apFirst , apSecond , bimap , chain , chainFirst , flatten , map , mapLeft , filterOrElse , fromEither , fromOption , fromPredicate } ;