co-log-core: Composable Contravariant Comonadic Logging Library

[ comonad, contravariant, library, logging, mpl ] [ Propose Tags ]

This package provides core types and functions to work with the LogAction data type which is both simple and powerful.

newtype LogAction m msg = LogAction
    { unLogAction :: msg -> m ()

The ideas behind this package are described in the following blog post:

See the following packages for different implementations based on co-log-core:

  • co-log: taggless final implementations.

  • co-log-polysemy: extensible effects implementation based on polysemy.

[Skip to Readme]


Note: This package has metadata revisions in the cabal description newer than included in the tarball. To unpack the package including the revisions, use 'cabal get'.

Maintainer's Corner

Package maintainers

For package maintainers and hackage trustees


Versions [RSS] 0.0.0, 0.1.0, 0.1.1,,,,,,
Change log
Dependencies base (>= && <4.19) [details]
License MPL-2.0
Copyright 2018-2020 Kowainik, 2021-2022 Co-Log
Author Dmitrii Kovanikov
Maintainer Kowainik <>
Revised Revision 2 made by alaendle at 2023-09-17T09:07:04Z
Category Logging, Contravariant, Comonad
Home page
Bug tracker
Source repo head: git clone
Uploaded by vrom911 at 2022-11-02T18:14:47Z
Distributions Arch:, LTSHaskell:, NixOS:, Stackage:
Reverse Dependencies 21 direct, 58 indirect [details]
Downloads 7078 total (119 in the last 30 days)
Rating 2.25 (votes: 2) [estimated by Bayesian average]
Your Rating
  • λ
  • λ
  • λ
Status Docs available [build log]
Last success reported on 2022-11-02 [all 1 reports]

Readme for co-log-core-

[back to package description]



GitHub CI Hackage MPL-2.0 license

co-log-core is a lightweight package that provides core types and functions to work with the @LogAction@ data type which is both simple and powerful.

How to use

co-log-core is compatible with the following GHC versions - supported versions

In order to start using co-log-core in your project, you will need to set it up with these steps:

  1. Add the dependency on co-log-core in your project's .cabal file. For this, you should modify the build-depends section according to the below section:

    build-depends: base ^>= LATEST_SUPPORTED_BASE
                 , co-log-core ^>= LATEST_VERSION
  2. To use this package, refer to the below example.

    module Main (main) where
    import Prelude hiding (log)
    import Colog.Core (LogAction, logStringStdout, (<&))
    app :: LogAction IO String -> IO ()
    app log = do
        log <& "Starting app..."
        log <& "Finishing app..."
    main :: IO ()
    main = app logStringStdout