Skip to content

Commit cddc073

Browse files
Update to v0.14.0-rc3 (#122)
* Update packages.dhall to prepare-0.14 bootstrap * Update CI to use v0.14.0-rc3 PS release * Add compiler's suggested kind annotations * Replace usages of SProxy with Proxy or proxy * Fix hash * Fix module name for Proxy * Specify all kinds to Type except for Forget and Tagged This reverts a prior change * Remove SHA hash from packages.dhall file
1 parent e7037b8 commit cddc073

File tree

10 files changed

+25
-8
lines changed

10 files changed

+25
-8
lines changed

.github/workflows/ci.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,8 @@ jobs:
1515

1616
- name: Set up a PureScript toolchain
1717
uses: purescript-contrib/setup-purescript@main
18+
with:
19+
purescript: "0.14.0-rc3"
1820

1921
- name: Cache PureScript dependencies
2022
uses: actions/cache@v2

packages.dhall

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
let upstream =
2-
https://github.com/purescript/package-sets/releases/download/psc-0.13.8-20201007/packages.dhall sha256:35633f6f591b94d216392c9e0500207bb1fec42dd355f4fecdfd186956567b6b
2+
https://raw.githubusercontent.com/purescript/package-sets/prepare-0.14/src/packages.dhall
33

44
in upstream

src/Data/Lens/Internal/Bazaar.purs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ import Data.Traversable (traverse)
1111
import Data.Tuple (Tuple(..))
1212

1313
-- | This is used to characterize a Traversal.
14+
newtype Bazaar :: (Type -> Type -> Type) -> Type -> Type -> Type -> Type -> Type
1415
newtype Bazaar p a b s t = Bazaar (forall f. Applicative f => p a (f b) -> s -> f t)
1516

1617
runBazaar :: forall p a b s t. Bazaar p a b s t -> (forall f. Applicative f => p a (f b) -> s -> f t)

src/Data/Lens/Internal/Forget.purs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ import Data.Tuple (fst, snd)
1717
-- |
1818
-- | `Forget r` is isomorphic to `Star (Const r)`, but can be given a `Cochoice`
1919
-- | instance.
20+
newtype Forget :: forall k. Type -> Type -> k -> Type
2021
newtype Forget r a b = Forget (a -> r)
2122

2223
derive instance newtypeForget :: Newtype (Forget r a b) _

src/Data/Lens/Internal/Indexed.purs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ import Data.Profunctor.Strong (class Strong, first, second)
1212
import Data.Tuple (Tuple(..))
1313

1414
-- | Profunctor used for `IndexedOptic`s.
15+
newtype Indexed :: (Type -> Type -> Type) -> Type -> Type -> Type -> Type
1516
newtype Indexed p i s t = Indexed (p (Tuple i s) t)
1617

1718
derive instance newtypeIndexed :: Newtype (Indexed p i s t) _

src/Data/Lens/Internal/Re.purs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ import Data.Profunctor.Cochoice (class Cochoice, unleft, unright)
1010
import Data.Profunctor.Costrong (class Costrong, unfirst, unsecond)
1111
import Data.Profunctor.Strong (class Strong, first, second)
1212

13+
newtype Re :: (Type -> Type -> Type) -> Type -> Type -> Type -> Type -> Type
1314
newtype Re p s t a b = Re (p b a -> p t s)
1415

1516
derive instance newtypeRe :: Newtype (Re p s t a b) _

src/Data/Lens/Internal/Tagged.purs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ import Data.Profunctor.Costrong (class Costrong)
1515
import Data.Traversable (class Traversable)
1616
import Data.Tuple (Tuple(..))
1717

18+
newtype Tagged :: forall k. k -> Type -> Type
1819
newtype Tagged a b = Tagged b
1920

2021
derive instance newtypeTagged :: Newtype (Tagged a b) _

src/Data/Lens/Record.purs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ module Data.Lens.Record (prop) where
33
import Prelude
44

55
import Data.Lens (Lens, lens)
6-
import Data.Symbol (class IsSymbol, SProxy)
6+
import Data.Symbol (class IsSymbol)
77
import Prim.Row as Row
88
import Record (get, set)
99

@@ -15,14 +15,14 @@ import Record (get, set)
1515
-- | For example:
1616
-- |
1717
-- | ```purescript
18-
-- | prop (SProxy :: SProxy "foo")
18+
-- | prop (Proxy :: Proxy "foo")
1919
-- | :: forall a b r. Lens { foo :: a | r } { foo :: b | r } a b
2020
-- | ```
2121
prop
22-
:: forall l r1 r2 r a b
22+
:: forall l r1 r2 r a b proxy
2323
. IsSymbol l
2424
=> Row.Cons l a r r1
2525
=> Row.Cons l b r r2
26-
=> SProxy l
26+
=> proxy l
2727
-> Lens (Record r1) (Record r2) a b
2828
prop l = lens (get l) (flip (set l))

src/Data/Lens/Types.purs

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,10 @@ type ATraversal s t a b = Optic (Bazaar (->) a b) s t a b
9696
type ATraversal' s a = ATraversal s s a a
9797

9898
-- | A general-purpose Data.Lens.
99+
type Optic :: (Type -> Type -> Type) -> Type -> Type -> Type -> Type -> Type
99100
type Optic p s t a b = p a b -> p s t
101+
102+
type Optic' :: (Type -> Type -> Type) -> Type -> Type -> Type
100103
type Optic' p s a = Optic p s s a a
101104

102105
type AnIso s t a b = Optic (Exchange a b) s t a b
@@ -130,9 +133,11 @@ type AGrate s t a b = Optic (Grating a b) s t a b
130133
type AGrate' s a = AGrate s s a a
131134

132135
-- | A getter.
136+
type Getter :: Type -> Type -> Type -> Type -> Type
133137
type Getter s t a b = forall r. Fold r s t a b
134138
type Getter' s a = Getter s s a a
135139

140+
type AGetter :: Type -> Type -> Type -> Type -> Type
136141
type AGetter s t a b = Fold a s t a b
137142
type AGetter' s a = AGetter s s a a
138143

@@ -141,14 +146,17 @@ type Setter s t a b = Optic Function s t a b
141146
type Setter' s a = Setter s s a a
142147

143148
-- | A review.
149+
type Review :: Type -> Type -> Type -> Type -> Type
144150
type Review s t a b = Optic Tagged s t a b
145151
type Review' s a = Review s s a a
146152

147153
-- | A fold.
154+
type Fold :: Type -> Type -> Type -> Type -> Type -> Type
148155
type Fold r s t a b = Optic (Forget r) s t a b
149156
type Fold' r s a = Fold r s s a a
150157

151158
-- | An indexed optic.
159+
type IndexedOptic :: (Type -> Type -> Type) -> Type -> Type -> Type -> Type -> Type -> Type
152160
type IndexedOptic p i s t a b = Indexed p i a b -> p s t
153161
type IndexedOptic' p i s a = IndexedOptic p i s s a a
154162

@@ -157,10 +165,12 @@ type IndexedTraversal i s t a b = forall p. Wander p => IndexedOptic p i s t a b
157165
type IndexedTraversal' i s a = IndexedTraversal i s s a a
158166

159167
-- | An indexed fold.
168+
type IndexedFold :: Type -> Type -> Type -> Type -> Type -> Type -> Type
160169
type IndexedFold r i s t a b = IndexedOptic (Forget r) i s t a b
161170
type IndexedFold' r i s a = IndexedFold r i s s a a
162171

163172
-- | An indexed getter.
173+
type IndexedGetter :: Type -> Type -> Type -> Type -> Type -> Type
164174
type IndexedGetter i s t a b = IndexedFold a i s t a b
165175
type IndexedGetter' i s a = IndexedGetter i s s a a
166176

test/Main.purs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,18 +17,18 @@ import Data.Lens.Setter (iover)
1717
import Data.Lens.Traversal (cloneTraversal)
1818
import Data.Lens.Zoom (ATraversal', IndexedTraversal', Traversal, Traversal', Lens, Lens', zoom)
1919
import Data.Maybe (Maybe(..))
20-
import Data.Symbol (SProxy(..))
2120
import Data.Tuple (Tuple(..), fst, snd)
2221
import Effect (Effect)
2322
import Effect.Console (logShow)
2423
import Partial.Unsafe (unsafePartial)
24+
import Type.Proxy (Proxy(..))
2525

2626
-- Traversing an array nested within a record
2727
foo :: forall a b r. Lens { foo :: a | r } { foo :: b | r } a b
28-
foo = prop (SProxy :: SProxy "foo")
28+
foo = prop (Proxy :: Proxy "foo")
2929

3030
bar :: forall a b r. Lens { bar :: a | r } { bar :: b | r } a b
31-
bar = prop (SProxy :: SProxy "bar")
31+
bar = prop (Proxy :: Proxy "bar")
3232

3333
barAndFoo :: forall a b r. Getter' { bar :: a, foo :: b | r } (Tuple a b)
3434
barAndFoo = takeBoth bar foo

0 commit comments

Comments
 (0)