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.17) [details]
License MPL-2.0
Copyright 2018-2020 Kowainik, 2021-2022 Co-Log
Author Dmitrii Kovanikov
Maintainer Kowainik <>
Category Logging, Contravariant, Comonad
Home page
Bug tracker
Source repo head: git clone
Uploaded by vrom911 at 2022-02-15T12:16:42Z
Distributions Arch:, LTSHaskell:, NixOS:, Stackage:
Reverse Dependencies 21 direct, 56 indirect [details]
Downloads 7078 total (119 in the last 30 days)
Rating 2.25 (votes: 2) [estimated by Bayesian average]
Your Rating
  • λ
  • λ
  • λ
Status Docs uploaded by user
Build status unknown [no reports yet]

Readme for co-log-core-

[back to package description]



GitHub CI Hackage Stackage LTS 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