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]


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.20) [details]
License MPL-2.0
Copyright 2018-2020 Kowainik, 2021-2023 Co-Log
Author Dmitrii Kovanikov
Maintainer Kowainik <>
Category Logging, Contravariant, Comonad
Home page
Bug tracker
Source repo head: git clone
Uploaded by alaendle at 2023-10-20T10:05:55Z
Distributions Arch:, LTSHaskell:, NixOS:, Stackage:
Reverse Dependencies 23 direct, 58 indirect [details]
Downloads 7903 total (186 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 2023-10-20 [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