@@ -125,7 +125,7 @@ import Data.Kind (Type)
125125--
126126-- 1. @'accum' ('const' (x, 'mempty'))@ @=@ @'pure' x@
127127-- 2. @'accum' f '*>' 'accum' g@ @=@
128- -- @'accum' '$' \acc -> let (_, v) = f acc
128+ -- @'accum' '$' \\ acc -> let (_, v) = f acc
129129-- (res, w) = g (acc '<>' v) in (res, v '<>' w)@
130130--
131131-- If you choose to define 'look' and 'add' instead, their definitions must obey
@@ -134,14 +134,14 @@ import Data.Kind (Type)
134134-- 1. @'look' '*>' 'look'@ @=@ @'look'@
135135-- 2. @'add' 'mempty'@ @=@ @'pure' ()@
136136-- 3. @'add' x '*>' 'add' y@ @=@ @'add' (x '<>' y)@
137- -- 4. @'add' x '*>' 'look'@ @=@ @'look' '>>=' \w -> 'add' x '$>' w '<>' x@
137+ -- 4. @'add' x '*>' 'look'@ @=@ @'look' '>>=' \\ w -> 'add' x '$>' w '<>' x@
138138--
139139-- If you want to define both, the relationship between them is as follows.
140140-- These are also the default definitions.
141141--
142- -- 1. @'look'@ @=@ @'accum' '$' \acc -> (acc, mempty)@
143- -- 2. @'add' x@ @=@ @'accum' '$' \acc -> ('()', x)@
144- -- 3. @'accum' f@ @=@ @'look' >>= \acc -> let (res, v) = f acc in 'add' v '$>' res@
142+ -- 1. @'look'@ @=@ @'accum' '$' \\ acc -> (acc, mempty)@
143+ -- 2. @'add' x@ @=@ @'accum' '$' \\ acc -> ('()', x)@
144+ -- 3. @'accum' f@ @=@ @'look' >>= \\ acc -> let (res, v) = f acc in 'add' v '$>' res@
145145--
146146-- @since 2.3
147147class (Monoid w , Monad m ) => MonadAccum w m | m -> w where
0 commit comments