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

Commit 8d128ac

Browse files
committed
Alphabetize imports.
Usually makes it easier to find the imports when you need to.
1 parent 6ef7f81 commit 8d128ac

File tree

11 files changed

+52
-36
lines changed

11 files changed

+52
-36
lines changed

docs/Optic/Laws/Lens.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,14 @@
22

33
Valid `Lens`es should satisfy three laws.
44

5+
#### `validLens`
6+
7+
``` purescript
8+
validLens :: forall s a b. (Eq a, Eq s) => LensP s a -> s -> a -> a -> a -> Boolean
9+
```
10+
11+
A valid `Lens` satisfies all three of the following laws.
12+
513
#### `getSet`
614

715
``` purescript

src/Optic/Core.purs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,14 +7,14 @@ module Optic.Core
77
, (..)
88
) where
99

10-
import Prelude (Semigroupoid, (<<<))
11-
1210
import Optic.Getter
1311
import Optic.Lens
1412
import Optic.Prism
1513
import Optic.Setter
1614
import Optic.Types
1715

16+
import Prelude (Semigroupoid, (<<<))
17+
1818
infixr 9 ..
1919

2020
-- | `..` is a synonym for `<<<` for aesthetic reasons.

src/Optic/Getter.purs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,13 +6,13 @@ module Optic.Getter
66

77
infixl 8 ^.
88

9-
import Prelude (Functor, (<$>))
9+
import Data.Const (getConst, Const(..))
10+
import Data.Functor.Contravariant ((>$<), Contravariant)
11+
import Data.Profunctor (dimap, rmap, Profunctor)
1012

1113
import Optic.Types (Getting())
1214

13-
import Data.Functor.Contravariant ((>$<), Contravariant)
14-
import Data.Const (getConst, Const(..))
15-
import Data.Profunctor (dimap, rmap, Profunctor)
15+
import Prelude (Functor, (<$>))
1616

1717
to :: forall a s f p. (Contravariant f, Functor f, Profunctor p) => (s -> a) -> p a (f a) -> p s (f s)
1818
to s2a = dimap s2a coerce

src/Optic/Internal/Prism.purs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
module Optic.Internal.Prism where
22

3-
import Prelude (Functor, ($), (>>>))
4-
53
import Data.Profunctor (Profunctor)
64
import Data.Profunctor.Choice (Choice)
75
import Data.Either (either, Either(..))
86

7+
import Prelude (Functor, ($), (>>>))
8+
99
data Market a b s t = Market (b -> t) (s -> Either t a)
1010
type MarketP a = Market a a
1111

src/Optic/Internal/Setter.purs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
module Optic.Internal.Setter where
22

3-
import Prelude (Applicative)
4-
53
import Data.Distributive (Distributive)
64
import Data.Identity (runIdentity, Identity(..))
75
import Data.Profunctor (rmap, Profunctor)
86
import Data.Traversable (Traversable)
97

8+
import Prelude (Applicative)
9+
1010
class (Applicative f, Distributive f, Traversable f) <= Settable f where
1111
untainted :: forall a. f a -> a
1212
untaintedDot :: forall a b p. (Profunctor p) => p a (f b) -> p a b

src/Optic/Laws/Lens.purs

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,13 @@ module Optic.Laws.Lens where
55
import Optic.Setter (set)
66
import Optic.Types (Lens(), LensP())
77

8-
import Prelude (Eq, (==))
8+
import Prelude (Eq, (&&), (==))
9+
10+
-- | A valid `Lens` satisfies all three of the following laws.
11+
validLens :: forall s a b. (Eq a, Eq s) => LensP s a -> s -> a -> a -> a -> Boolean
12+
validLens l s x y z = getSet l s
13+
&& setGet l s x
14+
&& setSet l s y z
915

1016
-- | If you get a value out, and then set it immediately back,
1117
-- | nothing should change.

src/Optic/Lens.purs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,10 @@ module Optic.Lens
33
, lens
44
) where
55

6-
import Prelude (Functor, (<$>))
7-
86
import Optic.Types (Lens())
97

8+
import Prelude (Functor, (<$>))
9+
1010
infixl 1 ??
1111

1212
lens :: forall s t a b. (s -> a) -> (s -> b -> t) -> Lens s t a b

src/Optic/Prism.purs

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -10,21 +10,21 @@ module Optic.Prism
1010
, withPrism
1111
) where
1212

13-
import Prelude ( Applicative, Eq
14-
, Unit()
15-
, ($), (==), (<<<), (<$>), (>>>)
16-
, const, not, pure, unit
17-
)
18-
19-
import Optic.Internal.Prism (Market(..))
20-
import Optic.Types (APrism(), Prism(), PrismP())
21-
2213
import Data.Either (either, Either(..))
2314
import Data.Identity (runIdentity, Identity(..))
2415
import Data.Maybe (maybe, Maybe(..))
2516
import Data.Profunctor (dimap)
2617
import Data.Profunctor.Choice (right, Choice)
2718

19+
import Optic.Internal.Prism (Market(..))
20+
import Optic.Types (APrism(), Prism(), PrismP())
21+
22+
import Prelude ( Applicative, Eq
23+
, Unit()
24+
, ($), (==), (<<<), (<$>), (>>>)
25+
, const, not, pure, unit
26+
)
27+
2828
clonePrism :: forall f p s t a b. (Applicative f, Choice p) => APrism s t a b -> p a (f b) -> p s (f t)
2929
clonePrism stab = withPrism stab prism
3030

src/Optic/Setter.purs

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -9,13 +9,6 @@ module Optic.Setter
99
, sets
1010
) where
1111

12-
import Prelude ( BooleanAlgebra, DivisionRing, Functor, Ring, Semigroup
13-
, Semiring
14-
, (+), (-), (*), (/), (||), (&&), (<>), (++), (<<<), (<$>)
15-
, (>>>)
16-
, const, flip
17-
)
18-
1912
import Data.Functor.Contravariant ((>$<), Contravariant)
2013
import Data.Identity (runIdentity, Identity(..))
2114
import Data.Maybe (Maybe(..))
@@ -24,6 +17,13 @@ module Optic.Setter
2417
import Optic.Internal.Setter (taintedDot, untaintedDot, Settable)
2518
import Optic.Types (ASetter(), ASetterP(), Optical(), Setter(), Setting())
2619

20+
import Prelude ( BooleanAlgebra, DivisionRing, Functor, Ring, Semigroup
21+
, Semiring
22+
, (+), (-), (*), (/), (||), (&&), (<>), (++), (<<<), (<$>)
23+
, (>>>)
24+
, const, flip
25+
)
26+
2727
infixr 4 %~
2828
infixr 4 .~
2929
infixr 4 +~

src/Optic/Types.purs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,16 @@
11
module Optic.Types where
22

3-
import Prelude
4-
5-
import Optic.Internal.Prism (Market())
6-
import Optic.Internal.Setter (Settable)
7-
83
import Data.Const (Const())
94
import Data.Functor.Contravariant (Contravariant)
105
import Data.Identity (Identity())
116
import Data.Profunctor (Profunctor)
127
import Data.Profunctor.Choice (Choice)
138

9+
import Optic.Internal.Prism (Market())
10+
import Optic.Internal.Setter (Settable)
11+
12+
import Prelude (Applicative, Functor)
13+
1414
type Accessing p m s a = p a (Const m a) -> s -> Const m s
1515

1616
type APrism s t a b = Market a b a (Identity b) -> Market a b s (Identity t)

0 commit comments

Comments
 (0)