
Hi All, I've been working my way through Yesod and noticed an irregularity. The GGHanlder monad stack (Yesod/Handler.hs) type GHInner s m monad a = ReaderT (HandlerData s m) ( ErrorT HandlerContents ( WriterT (Endo [Header]) ( StateT GHState monad ) ) ) a has a WriterT member based on "Endo [Header]", which is locally defined as type Endo a = a -> a Therefore, unless I'm missing something, the Writer T Monoid instance must be Monoid b => Monoid (a -> b) Monoid [a] (i.e., an environment to list construct). Assuming the results a finally extracted by applying [] (an empty environment), this would mean addHeader = GHandler . lift . lift . tell . (:) degrades to (++), giving non-constant time concatenation. I'm thinking what was really meant was to use the Endo Monoid instance, thereby gaining the constant-time concatenation via function composition. Cheers! -Tyson