co-log-polysemy: Composable Contravariant Comonadic Logging Library

[ comonad, contravariant, effects, library, logging, mpl, program ] [ Propose Tags ] [ Report a vulnerability ]

Implementation of the co-log logging based on the polysemy extensible effects library.

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

For the taggless final implementation of the co-log ideas se the following package:


[Skip to Readme]

Downloads

Maintainer's Corner

Package maintainers

For package maintainers and hackage trustees

Candidates

Versions [RSS] 0.0.0.0, 0.0.1.0, 0.0.1.1, 0.0.1.2, 0.0.1.3, 0.0.1.4, 0.0.1.5
Change log CHANGELOG.md
Dependencies base (>=4.11 && <4.21), co-log-core (>=0.3.0.0 && <0.4), co-log-polysemy, polysemy (>=1.2.0.0 && <1.10) [details]
Tested with ghc ==8.4.4, ghc ==8.6.5, ghc ==8.8.4, ghc ==8.10.7, ghc ==9.0.2, ghc ==9.2.8, ghc ==9.4.8, ghc ==9.6.5, ghc ==9.8.2, ghc ==9.10.1
License MPL-2.0
Copyright 2019-2020 Kowainik, 2021-2024 Co-Log
Author Dmitrii Kovanikov
Maintainer Kowainik <xrom.xkov@gmail.com>
Category Logging, Contravariant, Comonad, Effects
Home page https://github.com/co-log/co-log-polysemy
Bug tracker https://github.com/co-log/co-log-polysemy/issues
Source repo head: git clone https://github.com/co-log/co-log-polysemy.git
Uploaded by alaendle at 2024-06-08T11:25:44Z
Distributions LTSHaskell:0.0.1.5, NixOS:0.0.1.5, Stackage:0.0.1.5
Reverse Dependencies 7 direct, 5 indirect [details]
Executables play-colog-poly
Downloads 2168 total (20 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 2024-06-08 [all 1 reports]

Readme for co-log-polysemy-0.0.1.5

[back to package description]

co-log-polysemy

Co-logo

GitHub CI Hackage MPL-2.0 license

co-log-polysemy package is a implementation of the co-log-core logging based on the polysemy extensible effects library.

How to use

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

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

  1. Add the dependency on co-log-polysemy 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
                 , polysemy ^>= LATEST_VERSION
    
  2. To use this package, refer to the below example

    module Main (main) where
    
    import Prelude hiding (log)
    
    import Polysemy (Member, Sem, runM)
    
    import Colog.Core.IO (logStringStdout)
    import Colog.Polysemy (Log, log, runLogAction)
    
    
    example :: Member (Log String) r => Sem r ()
    example = do
         log @String "First message..."
         log @String "Second message..."
    
    main :: IO ()
    main = runM $ runLogAction @IO logStringStdout example