Skip to content
This repository was archived by the owner on Oct 4, 2020. It is now read-only.

Commit af2ec46

Browse files
committed
Exporting things.
1 parent eaf1341 commit af2ec46

7 files changed

Lines changed: 76 additions & 14 deletions

File tree

src/Control/Lens.purs

Lines changed: 38 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,9 @@ module Control.Lens
1818
, tail
1919
, uncons
2020
, unsnoc
21+
-- Equality
22+
, simple
23+
, simply
2124
-- Fold
2225
, (^..), (^?)
2326
, filtered
@@ -63,6 +66,19 @@ module Control.Lens
6366
, _Right
6467
, _Just
6568
, _Nothing
69+
-- Review
70+
, Review()
71+
, ReviewP()
72+
, AReview()
73+
, AReviewP()
74+
, (##)
75+
, re
76+
, reuse
77+
, reuses
78+
, review
79+
, reviews
80+
, unto
81+
, un
6682
-- Setter
6783
, (%~), (.~), (+~), (-~), (*~), (//~), (||~), (&&~), (<>~), (++~), (?~)
6884
, (%=), (.=), (+=), (-=), (*=), (//=), (||=), (&&=), (<>=), (++=), (?=)
@@ -143,16 +159,18 @@ module Control.Lens
143159
, TraversalP()
144160
, Traversal1()
145161
, Traversal1P()
146-
) where
162+
) where
147163

148164
import qualified Control.Lens.At as At
149165
import qualified Control.Lens.Cons as Cons
166+
import qualified Control.Lens.Equality as Equality
150167
import qualified Control.Lens.Fold as Fold
151168
import qualified Control.Lens.Getter as Getter
152169
import qualified Control.Lens.Indexed as Indexed
153170
import qualified Control.Lens.Iso as Iso
154171
import qualified Control.Lens.Lens as Lens
155172
import qualified Control.Lens.Prism as Prism
173+
import qualified Control.Lens.Review as Review
156174
import qualified Control.Lens.Setter as Setter
157175
import qualified Control.Lens.Traversal as Traversal
158176
import qualified Control.Lens.Tuple as Tuple
@@ -181,6 +199,10 @@ module Control.Lens
181199
uncons = Cons.uncons
182200
unsnoc = Cons.unsnoc
183201

202+
-- Equality
203+
simple = Equality.simple
204+
simply = Equality.simply
205+
184206
-- Fold
185207
infixl 8 ^..
186208
infixl 8 ^?
@@ -241,6 +263,21 @@ module Control.Lens
241263
_Just = Prism._Just
242264
_Nothing = Prism._Nothing
243265

266+
-- Review
267+
infixr 8 ##
268+
type Review s t a b = Review.Review s t a b
269+
type ReviewP t b = Review.ReviewP t b
270+
type AReview s t a b = Review.AReview s t a b
271+
type AReviewP t b = Review.AReviewP t b
272+
(##) = Review.(##)
273+
re = Review.re
274+
reuse = Review.reuse
275+
reuses = Review.reuses
276+
review = Review.review
277+
reviews = Review.reviews
278+
unto = Review.unto
279+
un = Review.un
280+
244281
-- Setter
245282
infixr 4 %~
246283
infixr 4 .~

src/Control/Lens/Equality.purs

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,12 @@
1-
module Control.Lens.Equality where
1+
module Control.Lens.Equality
2+
( simple
3+
, simply
4+
) where
25

3-
import Control.Lens.Type (OpticP())
6+
import Control.Lens.Type (EqualityP(), OpticP())
7+
8+
simple :: forall a. EqualityP a a
9+
simple = id
410

511
simply :: forall p f s a r. (OpticP p f s a -> r) -> OpticP p f s a -> r
612
simply = id

src/Control/Lens/README.md

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -98,6 +98,8 @@
9898

9999
### Values
100100

101+
simple :: forall a. EqualityP a a
102+
101103
simply :: forall p f s a r. (OpticP p f s a -> r) -> OpticP p f s a -> r
102104

103105

@@ -250,16 +252,11 @@
250252

251253
type ReviewP t b = Review t t b b
252254

253-
newtype Void where
254-
Void :: Void -> Void
255-
256255

257256
### Values
258257

259258
(##) :: forall s t a b. AReview s t a b -> b -> t
260259

261-
absurd :: forall a. Void -> a
262-
263260
re :: forall s t a b. AReview s t a b -> Getter b t
264261

265262
reuse :: forall m b a t s. (Monad m, MonadState b m) => AReview s t a b -> m t

src/Control/Lens/Review.purs

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,17 @@
1-
module Control.Lens.Review where
1+
module Control.Lens.Review
2+
( Review()
3+
, ReviewP()
4+
, AReview()
5+
, AReviewP()
6+
, (##)
7+
, re
8+
, reuse
9+
, reuses
10+
, review
11+
, reviews
12+
, unto
13+
, un
14+
) where
215

316
import Control.Lens.Getter (to, view, Getting())
417
import Control.Lens.Internal.Setter (Settable)

src/Control/README.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,10 @@
44

55
### Types
66

7+
type AReview s t a b = Review.AReview s t a b
8+
9+
type AReviewP t b = Review.AReviewP t b
10+
711
type Action m s a = Type.Action m s a
812

913
type As a = Type.As a
@@ -114,6 +118,10 @@
114118

115119
type RelevantMonadicFold m s a = Type.RelevantMonadicFold m s a
116120

121+
type Review s t a b = Review.Review s t a b
122+
123+
type ReviewP t b = Review.ReviewP t b
124+
117125
type Setter s t a b = Type.Setter s t a b
118126

119127
type SetterP s a = Type.SetterP s a

src/Data/Profunctor/Choice.purs

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@ module Data.Profunctor.Choice where
22

33
import Data.Either (Either(..))
44
import Data.Profunctor (Profunctor)
5-
import Data.Tagged (Tagged(..))
65

76
class (Profunctor p) <= Choice p where
87
left' :: forall a b c. p a b -> p (Either a c) (Either b c)
@@ -13,7 +12,3 @@ module Data.Profunctor.Choice where
1312
left' _ (Right c) = Right c
1413

1514
right' = (<$>)
16-
17-
instance choiceTagged :: Choice Tagged where
18-
left' (Tagged x) = Tagged $ Left x
19-
right' (Tagged x) = Tagged $ Right x

src/Data/Tagged.purs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,11 @@ module Data.Tagged where
88
import Data.Bifoldable (Bifoldable)
99
import Data.Bifunctor (bimap, Bifunctor)
1010
import Data.Bitraversable (bitraverse, Bitraversable)
11+
import Data.Either (Either(..))
1112
import Data.Foldable (Foldable)
1213
import Data.Monoid (mempty, Monoid)
1314
import Data.Profunctor (Profunctor)
15+
import Data.Profunctor.Choice (Choice)
1416
import Data.Traversable (Traversable)
1517

1618
newtype Tagged s b = Tagged b
@@ -88,3 +90,7 @@ module Data.Tagged where
8890

8991
instance profunctorTagged :: Profunctor Tagged where
9092
dimap _ f (Tagged x) = Tagged $ f x
93+
94+
instance choiceTagged :: Choice Tagged where
95+
left' (Tagged x) = Tagged $ Left x
96+
right' (Tagged x) = Tagged $ Right x

0 commit comments

Comments
 (0)