since import { Contravariant1 } from 'fp-ts/lib/Contravariant' ; import { Predicate } from 'fp-ts/lib/function' ; import { IO , io } from 'fp-ts/lib/IO' ; import { Monoid } from 'fp-ts/lib/Monoid' ; import { pipeable } from 'fp-ts/lib/pipeable' ; import { getLoggerM } from '.' ; import { URIS3 , Kind3 , URIS2 , Kind2 , URIS , Kind , HKT } from 'fp-ts/lib/HKT' ; import { MonadIO3 , MonadIO2C , MonadIO2 , MonadIO1 , MonadIO } from 'fp-ts/lib/MonadIO' ; const T = getLoggerM ( io ) ; declare module 'fp-ts/lib/HKT' { interface URItoKind < A > { LoggerIO : LoggerIO < A > ; } } since export const URI = 'LoggerIO' ; since export type URI = typeof URI ; since export interface LoggerIO < A > { ( a ) : IO < void > ; } since export const filter = T . filter ; since export const getMonoid = T . getMonoid ; since export const loggerIO = { URI , contramap : T . contramap } ; category since example export function withLogger < M extends URIS3 > ( M ) ; export function withLogger < M extends URIS2 > ( M ) ; export function withLogger < M extends URIS2 , E > ( M ) ; export function withLogger < M extends URIS > ( M ) ; export function withLogger < M > ( M ) ; export function withLogger < M > ( M ) { return ( logger ) => ( message ) => ( ma ) => M . chain ( ma , ( a ) => M . map ( M . fromIO ( logger ( message ( a ) ) ) , ( ) => a ) ) ; } const { contramap } = pipeable ( loggerIO ) ; export { contramap } ;