File tree Expand file tree Collapse file tree 1 file changed +4
-2
lines changed
co-log-core/src/Colog/Core Expand file tree Collapse file tree 1 file changed +4
-2
lines changed Original file line number Diff line number Diff line change @@ -19,7 +19,7 @@ module Colog.Core.Class
19
19
) where
20
20
21
21
import Colog.Core.Action (LogAction )
22
-
22
+ import Data.Functor.Const ( Const ( .. ))
23
23
24
24
-- to inline lens better
25
25
{- HLINT ignore "Redundant lambda" -}
@@ -37,10 +37,12 @@ Every instance of the this typeclass should satisfy the following laws:
37
37
4. __Set-Over:__ @'overLogAction' f env ≡ 'setLogAction' (f $ 'getLogAction' env) env@
38
38
-}
39
39
class HasLog env msg m where
40
- {-# MINIMAL getLogAction, (setLogAction | overLogAction) #-}
40
+ {-# MINIMAL logActionL | ( getLogAction , (setLogAction | overLogAction) ) #-}
41
41
42
42
-- | Extracts 'LogAction' from the environment.
43
43
getLogAction :: env -> LogAction m msg
44
+ getLogAction = getConst . logActionL Const
45
+ {-# INLINE getLogAction #-}
44
46
45
47
-- | Sets 'LogAction' to the given one inside the environment.
46
48
setLogAction :: LogAction m msg -> env -> env
You can’t perform that action at this time.
0 commit comments