From 91d17d7e6024c56885e485c3fe49dc0f26c060fe Mon Sep 17 00:00:00 2001 From: Steven Shuck Date: Sat, 25 Oct 2025 05:30:50 -0400 Subject: [PATCH] Explicit method impls for MonadState and MonadWriter Product instances --- Control/Monad/State/Class.hs | 1 + Control/Monad/Writer/Class.hs | 3 ++- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/Control/Monad/State/Class.hs b/Control/Monad/State/Class.hs index 71f0770..67a161b 100644 --- a/Control/Monad/State/Class.hs +++ b/Control/Monad/State/Class.hs @@ -197,3 +197,4 @@ instance MonadState s m => MonadState s (SelectT r m) where instance (MonadState s m, MonadState s n) => MonadState s (Product m n) where get = Pair get get put s = Pair (put s) (put s) + state sas = Pair (state sas) (state sas) diff --git a/Control/Monad/Writer/Class.hs b/Control/Monad/Writer/Class.hs index 980cfb3..fa4450b 100644 --- a/Control/Monad/Writer/Class.hs +++ b/Control/Monad/Writer/Class.hs @@ -208,6 +208,7 @@ instance pass = Accum.liftPass pass instance (MonadWriter w m, MonadWriter w n) => MonadWriter w (Product m n) where - tell w = Pair (tell w) (tell w) + writer aw = Pair (writer aw) (writer aw) + tell w = Pair (tell w) (tell w) listen (Pair ma na) = Pair (listen ma) (listen na) pass (Pair maf naf) = Pair (pass maf) (pass naf)