Skip to content

Commit b033aaa

Browse files
committed
names
1 parent a75c479 commit b033aaa

File tree

3 files changed

+10
-10
lines changed

3 files changed

+10
-10
lines changed

src/Control/Lens/Monocle.hs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ prop> traverse = ditraversed
6868
prop> cotraversed = ditraversed
6969
-}
7070
ditraversed :: (Traversable g, Distributive g) => Monocle (g a) (g b) a b
71-
ditraversed = unwrapPafb . replicateP . WrapPafb
71+
ditraversed = unwrapPafb . ditraverse . WrapPafb
7272

7373
{- | Repeat action indefinitely. -}
7474
forevered :: Monocle s t () b

src/Data/Profunctor/Distributor.hs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -213,7 +213,7 @@ class Traversable t => Homogeneous t where
213213
Any `Traversable` & `Distributive` countable product
214214
can be given a default implementation for the `homogeneously` method.
215215
216-
prop> homogeneously = replicateP
216+
prop> homogeneously = ditraverse
217217
218218
And any user-defined homogeneous algebraic datatype has
219219
a default instance for `Homogeneous`, by deriving `Generic1`.

src/Data/Profunctor/Monoidal.hs

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -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`,
9999
repeating an action a number of times.
100100
However, instead of an `Int` term, it expects
101101
a `Traversable` & `Distributive` type. Such a
102102
type 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. -}
110110
asEmpty :: (AsEmpty s, Monoidal p, Choice p) => p s s
@@ -115,11 +115,11 @@ asEmpty = _Empty >? oneP
115115
x >:< xs = _Cons >? x >*< xs
116116
infixr 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

Comments
 (0)