export declare const Functor: Functor2<URI>
- Added in 0.1.0
- MIT – Copyright (c) 2017-present Giulio Canti
export declare function getComonad<P>(monoid: Monoid<P>): Comonad2C<URI, P>
- Added in 0.1.0
- MIT – Copyright (c) 2017-present Giulio Canti
export declare const flap: <A>(a: A) => <E, B>(fab: Traced<E, (a: A) => B>) => Traced<E, B>
- Added in 0.1.0
- MIT – Copyright (c) 2017-present Giulio Canti
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.
export declare const map: <A, B>(f: (a: A) => B) => <E>(fa: Traced<E, A>) => Traced<E, B>
- Added in 0.1.0
- MIT – Copyright (c) 2017-present Giulio Canti
export interface Traced<P, A> {
(p: P): A
}
- Added in 0.1.0
- MIT – Copyright (c) 2017-present Giulio Canti
export type URI = typeof URI
- Added in 0.1.0
- MIT – Copyright (c) 2017-present Giulio Canti
export declare const URI = 'Traced'
- Added in 0.1.0
- MIT – Copyright (c) 2017-present Giulio Canti
Apply a function to the current position
export declare function censor<P>(f: (p: P) => P): <A>(wa: Traced<P, A>) => Traced<P, A>
- Added in 0.1.0
- MIT – Copyright (c) 2017-present Giulio Canti
Get the current position
export declare function listen<P, A>(wa: Traced<P, A>): Traced<P, [A, P]>
- Added in 0.1.0
- MIT – Copyright (c) 2017-present Giulio Canti
Get a value which depends on the current position
export declare function listens<P, B>(f: (p: P) => B): <A>(wa: Traced<P, A>) => Traced<P, [A, B]>
- Added in 0.1.0
- MIT – Copyright (c) 2017-present Giulio Canti
Use Functor
instead.
export declare const traced: Functor2<URI>
- Added in 0.1.0
- Deprecated
- MIT – Copyright (c) 2017-present Giulio Canti
Extracts a value at a relative position which depends on the current value.
export declare function tracks<P, A>(M: Monoid<P>, f: (a: A) => P): (wa: Traced<P, A>) => A
- Added in 0.1.0
- MIT – Copyright (c) 2017-present Giulio Canti