Link Search Menu Expand Document

index overview

Adapted from https://github.com/rightfold/purescript-logging

Added in v0.3.0


Table of contents


Logger (interface)

A logger receives records and potentially performs some effects

Signature

export interface Logger<M, A> {
  (a: A): HKT<M, void>
}

Added in v0.3.0

Logger1 (interface)

Signature

export interface Logger1<M extends URIS, A> {
  (a: A): Kind<M, void>
}

Added in v0.3.0

Logger2 (interface)

Signature

export interface Logger2<M extends URIS2, E, A> {
  (a: A): Kind2<M, E, void>
}

Added in v0.3.3

LoggerM (interface)

Signature

export interface LoggerM<M> {
  readonly contramap: <A, B>(fa: Logger<M, A>, f: (b: B) => A) => Logger<M, B>
  readonly filter: <A>(logger: Logger<M, A>, predicate: Predicate<A>) => Logger<M, A>
  readonly getMonoid: <A = never>() => Monoid<Logger<M, A>>
}

Added in v0.3.0

LoggerM1 (interface)

Signature

export interface LoggerM1<M extends URIS> {
  readonly contramap: <A, B>(fa: Logger1<M, A>, f: (b: B) => A) => Logger1<M, B>
  readonly filter: <A>(logger: Logger1<M, A>, predicate: Predicate<A>) => Logger1<M, A>
  readonly getMonoid: <A = never>() => Monoid<Logger1<M, A>>
}

Added in v0.3.0

LoggerM2 (interface)

Signature

export interface LoggerM2<M extends URIS2> {
  readonly contramap: <E, A, B>(fa: Logger2<M, E, A>, f: (b: B) => A) => Logger2<M, E, B>
  readonly filter: <E, A>(logger: Logger2<M, E, A>, predicate: Predicate<A>) => Logger2<M, E, A>
  readonly getMonoid: <E, A>() => Monoid<Logger2<M, E, A>>
}

Added in v0.3.3

getLoggerM

Signature

export function getLoggerM<M extends URIS2>(M: Applicative2<M>): LoggerM2<M>
export function getLoggerM<M extends URIS>(M: Applicative1<M>): LoggerM1<M>
export function getLoggerM<M>(M: Applicative<M>): LoggerM<M> { ... }

Added in v0.3.0