Skip to main content

Traced

Instances

Mapping

Model

Type lambdas

Utilities

Instances

Functor

Signature

export declare const Functor: Functor2<URI>

Details

  • Added in 0.1.0

License

  • MIT – Copyright (c) 2017-present Giulio Canti

getComonad

Signature

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

Details

  • Added in 0.1.0

License

  • MIT – Copyright (c) 2017-present Giulio Canti

Mapping

flap

Signature

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

Details

  • Added in 0.1.0

License

  • MIT – Copyright (c) 2017-present Giulio Canti

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>

Details

  • Added in 0.1.0

License

  • MIT – Copyright (c) 2017-present Giulio Canti

Model

Traced

Signature

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

Details

  • Added in 0.1.0

License

  • MIT – Copyright (c) 2017-present Giulio Canti

Type lambdas

URI

Signature

export type URI = typeof URI

Details

  • Added in 0.1.0

License

  • MIT – Copyright (c) 2017-present Giulio Canti

URI

Signature

export declare const URI = 'Traced'

Details

  • Added in 0.1.0

License

  • MIT – Copyright (c) 2017-present Giulio Canti

Utilities

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>

Details

  • Added in 0.1.0

License

  • MIT – Copyright (c) 2017-present Giulio Canti

listen

Get the current position

Signature

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

Details

  • Added in 0.1.0

License

  • MIT – Copyright (c) 2017-present Giulio Canti

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]>

Details

  • Added in 0.1.0

License

  • MIT – Copyright (c) 2017-present Giulio Canti

traced

Use Functor instead.

Signature

export declare const traced: Functor2<URI>

Details

  • Added in 0.1.0
  • Deprecated

License

  • MIT – Copyright (c) 2017-present Giulio Canti

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

Details

  • Added in 0.1.0

License

  • MIT – Copyright (c) 2017-present Giulio Canti