Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/co-log/co-log-core
🌽 Core types and functions that power the Haskell `co-log` implementation
https://github.com/co-log/co-log-core
co-log contravariant core hacktoberfest haskell logging
Last synced: about 1 month ago
JSON representation
🌽 Core types and functions that power the Haskell `co-log` implementation
- Host: GitHub
- URL: https://github.com/co-log/co-log-core
- Owner: co-log
- License: mpl-2.0
- Created: 2021-09-29T19:51:20.000Z (over 3 years ago)
- Default Branch: main
- Last Pushed: 2024-06-08T11:18:53.000Z (7 months ago)
- Last Synced: 2024-11-12T18:31:52.453Z (about 2 months ago)
- Topics: co-log, contravariant, core, hacktoberfest, haskell, logging
- Language: Haskell
- Homepage:
- Size: 117 KB
- Stars: 17
- Watchers: 3
- Forks: 6
- Open Issues: 4
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
- Codeowners: .github/CODEOWNERS
Awesome Lists containing this project
README
# co-log-core
![Co-logo](https://user-images.githubusercontent.com/8126674/80955687-92f21a80-8df7-11ea-90d3-422dafdc8391.png)
[![GitHub CI](https://github.com/co-log/co-log-core/workflows/CI/badge.svg)](https://github.com/co-log/co-log-core/actions)
[![Hackage][hk-img-core]][hk-core]
[![MPL-2.0 license](https://img.shields.io/badge/license-MPL--2.0-blue.svg)](https://github.com/co-log/co-log/blob/main/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](https://matrix.hackage.haskell.org/#/package/co-log-core)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:```haskell
build-depends: base ^>= LATEST_SUPPORTED_BASE
, co-log-core ^>= LATEST_VERSION
```2. To use this package, refer to the below example.
```haskell
module Main (main) whereimport 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
```
[hk-img-core]: https://img.shields.io/hackage/v/co-log-core.svg?logo=haskell
[hk-core]: https://hackage.haskell.org/package/co-log-core