@@ -4,8 +4,8 @@ module Data.Profunctor.Monoidal
44 ( -- * Monoidal
55 Monoidal
66 , oneP , (>*<) , (>*) , (*<)
7- , dimap2 , foreverP , replicateP
8- , (>:<) , asEmpty , replicateN
7+ , dimap2 , foreverP , ditraverse
8+ , (>:<) , asEmpty , replicateP
99 , meander , eotFunList
1010 ) where
1111
@@ -95,16 +95,16 @@ foreverP a = let a' = a >* a' in a'
9595
9696{- | Thanks to Fy on Monoidal Café Discord.
9797
98- `replicateP ` is roughly analagous to `replicateM`,
98+ `ditraverse ` is roughly analagous to `replicateM`,
9999repeating an action a number of times.
100100However, instead of an `Int` term, it expects
101101a `Traversable` & `Distributive` type. Such a
102102type is a homogeneous countable product.
103103-}
104- replicateP
104+ ditraverse
105105 :: (Traversable t , Distributive t , Monoidal p )
106106 => p a b -> p (t a ) (t b )
107- replicateP p = traverse (\ f -> lmap f p) (distribute id )
107+ ditraverse p = traverse (\ f -> lmap f p) (distribute id )
108108
109109{- | A `Monoidal` nil operator. -}
110110asEmpty :: (AsEmpty s , Monoidal p , Choice p ) => p s s
@@ -115,11 +115,11 @@ asEmpty = _Empty >? oneP
115115x >:< xs = _Cons >? x >*< xs
116116infixr 5 >:<
117117
118- replicateN
118+ replicateP
119119 :: (Monoidal p , Choice p , AsEmpty s , AsEmpty t , Cons s t a b )
120120 => Int -> p a b -> p s t
121- replicateN n _ | n <= 0 = lmap (const Empty ) asEmpty
122- replicateN n a = a >:< replicateN (n- 1 ) a
121+ replicateP n _ | n <= 0 = lmap (const Empty ) asEmpty
122+ replicateP n a = a >:< replicateP (n- 1 ) a
123123
124124{- | For any `Monoidal`, `Choice` & `Strong` `Profunctor`,
125125`meander` is invertible and gives a default implementation for the
0 commit comments