michaelpj / co-log-core

🌽 Core types and functions that power the Haskell `co-log` implementation

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

co-log-core

Co-logo

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

About

🌽 Core types and functions that power the Haskell `co-log` implementation

License:Mozilla Public License 2.0


Languages

Language:Haskell 100.0%