Traced overview

Added in v2.0.0


Table of contents


instances

Functor

Signature

export declare const Functor: Functor2<'Traced'>

Added in v2.7.0

getComonad

Signature

export declare function getComonad<P>(monoid: Monoid<P>): Comonad2C<URI, P>

Added in v2.0.0

mapping

flap

Signature

export declare const flap: <A>(a: A) => <E, B>(fab: Traced<E, (a: A) => B>) => Traced<E, B>

Added in v2.10.0

map

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

model

Traced (interface)

Signature

export interface Traced<P, A> {
  (p: P): A
}

Added in v2.0.0

type lambdas

URI

Signature

export declare const URI: 'Traced'

Added in v2.0.0

URI (type alias)

Signature

export type URI = typeof URI

Added in v2.0.0

utils

censor

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

listen

Get the current position

Signature

export declare function listen<P, A>(wa: Traced<P, A>): Traced<P, [A, P]>

Added in v2.0.0

listens

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

tracks

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

zone of death

traced

Use Functor instead.

Signature

export declare const traced: Functor2<'Traced'>

Added in v2.0.0