HORIZON HASKELLDocslts/ghc-9.10.x248f8f02026-10-05Search names, modules, packages, or :: a typeCtrl K

GHC 9.10.3 · lts/ghc-9.10.x · 248f8f0 · 2026-10-05

Moduleco-log-core-0.3.2.2Haskell2010

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.

  • 1 type
  • 1 class
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.2 · Colog.Core.Class

Lens

1 declaration

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).