Added in v2.0.0
map
can be used to turn functions (a: A) => B
into functions (fa: F<A>) => F<B>
whose argument and return types
use the type constructor F
to represent some computational context.
Signature
export declare const map: <A, B>(f: (a: A) => B) => <E>(fa: Traced<E, A>) => Traced<E, B>
Added in v2.0.0
Signature
export declare const Functor: Functor2<'Traced'>
Added in v2.7.0
Signature
export declare const URI: 'Traced'
Added in v2.0.0
Signature
export type URI = typeof URI
Added in v2.0.0
Signature
export declare function getComonad<P>(monoid: Monoid<P>): Comonad2C<URI, P>
Added in v2.0.0
Signature
export declare const traced: Functor2<'Traced'>
Added in v2.0.0
Signature
export interface Traced<P, A> {
(p: P): A
}
Added in v2.0.0
Apply a function to the current position
Signature
export declare function censor<P>(f: (p: P) => P): <A>(wa: Traced<P, A>) => Traced<P, A>
Added in v2.0.0
Get the current position
Signature
export declare function listen<P, A>(wa: Traced<P, A>): Traced<P, [A, P]>
Added in v2.0.0
Get a value which depends on the current position
Signature
export declare function listens<P, B>(f: (p: P) => B): <A>(wa: Traced<P, A>) => Traced<P, [A, B]>
Added in v2.0.0
Extracts a value at a relative position which depends on the current value.
Signature
export declare function tracks<P, A>(M: Monoid<P>, f: (a: A) => P): (wa: Traced<P, A>) => A
Added in v2.0.0