HORIZON HASKELLDocslts/ghc-10.0.x8fef28d2026-11-02Search packagesCtrl K
Theme: |

GHC 10.0.0.20260917 · lts/ghc-10.0.x · 8fef28d · 2026-11-02

Moduleco-log-core-0.3.2.7Haskell2010

Colog.Core.Class

SPDX-License-Identifier : MPL-2.0 Maintainer : Co-Log xrom.xkov@gmail.com Stability : Stable Portability : Portable

Provides type class for values that has access to LogAction.

Contents
  1. Lens
Synopsis
classclass HasLog env msg (m :: Type -> Type) where

This types class contains simple pair of getter-setter and related functions. It also provides the useful lens logActionL with the default implementation using type class methods. The default one could be easily overritten under your instances.

Every instance of the this typeclass should satisfy the following laws:

  1. Set-Get: getLogAction (setLogAction l env) ≡ l

  2. Get-Set: setLogAction (getLogAction env) env ≡ env

  3. Set-Set: setLogAction l2 (setLogAction l1 env) ≡ setLogAction l2 env

  4. Set-Over: overLogAction f env ≡ setLogAction (f $ getLogAction env) env

Methods

Instances1HasLog
  • HasLog (LogAction m msg) msg mDefined in co-log-core-0.3.2.7 · Colog.Core.Class

Lens

To keep co-log-core a lightweight library it was decided to introduce local Lens' type alias as it doesn't harm.

typetype Lens' s a = forall (f :: Type -> Type). Functor f => (a -> f a) -> s -> f s

The monomorphic lenses which don't change the type of the container (or of the value inside).